This is an automated email from the ASF dual-hosted git repository.

ayushsaxena pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new a14a1e12cb1 HIVE-28701: OTEL: Fix race condition due to unavailability 
of Query Id. (#5604). (Ayush Saxena, reviewed by Simhadri Govindappa, Tanishq 
Chugh)
a14a1e12cb1 is described below

commit a14a1e12cb12b63bb796a7643ed99cfca2b5fd51
Author: Ayush Saxena <[email protected]>
AuthorDate: Fri Jan 10 15:04:45 2025 +0530

    HIVE-28701: OTEL: Fix race condition due to unavailability of Query Id. 
(#5604). (Ayush Saxena, reviewed by Simhadri Govindappa, Tanishq Chugh)
---
 service/src/java/org/apache/hive/service/servlet/OTELExporter.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/service/src/java/org/apache/hive/service/servlet/OTELExporter.java 
b/service/src/java/org/apache/hive/service/servlet/OTELExporter.java
index bd70b179e25..1fb53715ed0 100644
--- a/service/src/java/org/apache/hive/service/servlet/OTELExporter.java
+++ b/service/src/java/org/apache/hive/service/servlet/OTELExporter.java
@@ -34,6 +34,7 @@ import io.opentelemetry.sdk.internal.AttributesMap;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.hadoop.hive.common.OTELJavaMetrics;
 import org.apache.hadoop.hive.ql.QueryDisplay;
 import org.apache.hadoop.hive.ql.QueryInfo;
@@ -86,8 +87,8 @@ public class OTELExporter extends Thread {
 
     LOG.debug("Found {} liveQueries and {} historicalQueries", 
liveQueries.size(), historicalQueries.size());
 
-    for (QueryInfo lQuery: liveQueries){
-      if(lQuery.getQueryDisplay() == null){
+    for (QueryInfo lQuery : liveQueries) {
+      if (lQuery.getQueryDisplay() == null || 
StringUtils.isEmpty(lQuery.getQueryDisplay().getQueryId())) {
         continue;
       }
       String queryID = lQuery.getQueryDisplay().getQueryId();

Reply via email to