yashmayya commented on code in PR #17306:
URL: https://github.com/apache/pinot/pull/17306#discussion_r2582210950


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/blocks/ErrorMseBlock.java:
##########
@@ -137,4 +138,16 @@ public String toString() {
       return "{\"type\": \"error\", \"errorMessages\": \"not serializable\"}";
     }
   }
+
+  /// Returns the main error code of the block.
+  ///
+  /// Right now this just returns the first error code in the map or UNKNOWN 
if the map is empty,
+  /// but in the future we might want to have a more sophisticated

Review Comment:
   Incomplete sentence?



##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/blocks/ErrorMseBlock.java:
##########
@@ -137,4 +138,16 @@ public String toString() {
       return "{\"type\": \"error\", \"errorMessages\": \"not serializable\"}";
     }
   }
+
+  /// Returns the main error code of the block.
+  ///
+  /// Right now this just returns the first error code in the map or UNKNOWN 
if the map is empty,
+  /// but in the future we might want to have a more sophisticated
+  public QueryErrorCode getMainErrorCode() {
+    Iterator<QueryErrorCode> iterator = _errorMessages.keySet().iterator();
+    if (!iterator.hasNext()) {
+      return QueryErrorCode.UNKNOWN;
+    }
+    return iterator.next();

Review Comment:
   I'm probably missing some context here - what scenarios would have multiple 
errors per block? And why do we need to change the code to throw / log only the 
first error?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to