gortiz commented on code in PR #17306:
URL: https://github.com/apache/pinot/pull/17306#discussion_r2622173885
##########
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:
TBH, I don't know. This is something I asked myself several times and
requires repetitive boilerplate code. We may decide to remove that in the
future.
--
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]