From 4e589a5cf1eefe28c253dc6740e863272de6d1fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E8=89=BA=E4=B8=B9?= <53546877+Craven1701@users.noreply.github.com> Date: Fri, 8 Aug 2025 10:20:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AF=B9=E4=BA=8Eapplication?= =?UTF-8?q?=20id=E7=9A=84=E6=AD=A3=E5=88=99=E5=8C=B9=E9=85=8D=E8=A7=84?= =?UTF-8?q?=E5=88=99=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=9C=A8spark-sql=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=97=B6=E6=97=A0=E6=B3=95=E5=8C=B9=E9=85=8DApplicant?= =?UTF-8?q?=20Id=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../omniadvisor/service/spark_service/spark_executor.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/omniadvisor/src/omniadvisor/service/spark_service/spark_executor.py b/omniadvisor/src/omniadvisor/service/spark_service/spark_executor.py index 2bcb584f60..f6ad6a10bd 100644 --- a/omniadvisor/src/omniadvisor/service/spark_service/spark_executor.py +++ b/omniadvisor/src/omniadvisor/service/spark_service/spark_executor.py @@ -75,10 +75,14 @@ class SparkExecutor: # 解析Application id: # 该条匹配模式的文本来自Spark3.3.1源码中yarn/Client.scala文件在Line224所打印的日志 # 若Spark版本迭代时对该日志内容做出修改 则存在application id匹配失败的风险 - pattern = r'Client: Submitting application (application_\d+_\d+) to ResourceManager' + pattern = r'Client: Submitting application (application_\d+_\d+) to ResourceManager|Application Id: (.*)\n' search_obj = re.search(pattern, spark_output) if search_obj: - application_id = search_obj.group(1) + application_id = search_obj.group(1) or search_obj.group(2) + if search_obj.group(1): + global_logger.debug(f"Match group 1, application id is {application_id}") + if search_obj.group(2): + global_logger.debug(f"Match group 2, application id is {application_id}") else: raise RuntimeError('Can not find application id message in spark output.') -- Gitee