[ https://issues.apache.org/jira/browse/DRILL-6123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16359154#comment-16359154 ]
ASF GitHub Bot commented on DRILL-6123: --------------------------------------- Github user ppadma commented on a diff in the pull request: https://github.com/apache/drill/pull/1107#discussion_r167380394 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/spill/RecordBatchSizer.java --- @@ -137,10 +137,10 @@ public ColumnSize(ValueVector v, String prefix) { case MAP: case UNION: // No standard size for Union type - dataSize = v.getPayloadByteCount(valueCount); + dataSize = valueCount == 0 ? 0 : v.getPayloadByteCount(valueCount); --- End diff -- When we get empty batch, getPayloadByteCount will throw out of bounds exception if the underlying method tries to read the value vector for index 0 i.e. when it is trying to read offset vector. I added the check in those methods and removed here. I still have to retain the check here for the case when we are trying to read the offset vector. > Limit batch size for Merge Join based on memory > ----------------------------------------------- > > Key: DRILL-6123 > URL: https://issues.apache.org/jira/browse/DRILL-6123 > Project: Apache Drill > Issue Type: Improvement > Components: Execution - Flow > Affects Versions: 1.12.0 > Reporter: Padma Penumarthy > Assignee: Padma Penumarthy > Priority: Major > Fix For: 1.13.0 > > > Merge join limits output batch size to 32K rows irrespective of row size. > This can create very large or very small batches (in terms of memory), > depending upon average row width. Change this to figure out output row count > based on memory specified with the new outputBatchSize option and average row > width of incoming left and right batches. Output row count will be minimum of > 1 and max of 64k. -- This message was sent by Atlassian JIRA (v7.6.3#76005)