walterddr commented on code in PR #9064:
URL: https://github.com/apache/pinot/pull/9064#discussion_r927855993


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/blocks/TransferableBlock.java:
##########
@@ -97,10 +122,38 @@ public BaseDataBlock getDataBlock() {
     return _dataBlock;
   }
 
+  /**
+   * Return the type of block (one of ROW, COLUMNAR, or METADATA).
+   *
+   * @return return type of block
+   */
   public BaseDataBlock.Type getType() {
     return _type;
   }
 
+  /**
+   * Return whether a transferable block is at the end of a stream.
+   *
+   * <p>End of stream is different from data block with 0-rows. which can 
indicate that one partition of the execution
+   * returns no rows. but that doesn't mean the rest of the partitions are 
also finished.
+   * <p>When an exception is caught within a stream, no matter how many 
outstanding data is pending to be received,
+   * it is considered end of stream because the exception should bubble up 
immediately.
+   *
+   * @return whether this block is the end of stream.
+   */
+  public boolean isEndOfStreamBlock() {
+    return _isErrorBlock || _type == BaseDataBlock.Type.METADATA;

Review Comment:
   good idea. let me think about this.



-- 
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