Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/20636#discussion_r195107427 --- Diff: sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/codegen/BufferHolder.java --- @@ -61,12 +61,15 @@ * Grows the buffer by at least neededSize and points the row to the buffer. */ void grow(int neededSize) { - if (neededSize > ARRAY_MAX - totalSize()) { + assert neededSize < 0 : + "Cannot grow BufferHolder by size " + neededSize + " because the size is negative"; + int roundedSize = ByteArrayMethods.roundNumberOfBytesToNearestWord(neededSize); --- End diff -- now I recall why we don't need this. We always grow to double of the previous size, or the max size. So as long as the initial size is word aligned, and the max size is word aligned, we are fine.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org