Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -285,19 +285,19 @@ public void reserve(int requiredCapacity) {
try {
reserveInternal(newCapacity);
} catch (OutOfMemoryError outOfMemoryError) {
throwUnsupportedException(newCapacity, requiredCapacity, outOfMemoryError);
throwUnsupportedException(requiredCapacity, outOfMemoryError);
}
} else {
throwUnsupportedException(newCapacity, requiredCapacity, null);
throwUnsupportedException(requiredCapacity, null);
}
}
}

private void throwUnsupportedException(int newCapacity, int requiredCapacity, Throwable cause) {
String message = "Cannot reserve more than " + newCapacity +
" bytes in the vectorized reader (requested = " + requiredCapacity + " bytes). As a" +
" workaround, you can disable the vectorized reader by setting "
+ SQLConf.PARQUET_VECTORIZED_READER_ENABLED().key() + " to false.";
private void throwUnsupportedException(int requiredCapacity, Throwable cause) {
String message = "Cannot reserve additional contiguous bytes in the vectorized reader " +
"(requested = " + requiredCapacity + " bytes). As a workaround, you can disable the " +
"vectorized reader by setting " + SQLConf.PARQUET_VECTORIZED_READER_ENABLED().key() +
" to false.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to also explain what's the cause of this error in the error message?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the first line work: Cannot reserve additional contiguous bytes in the vectorized reader? Do you have something in mind?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I was thinking if we can explain the reason that fails the allocation instead of just saying we cannot allocate mem.


if (cause != null) {
throw new RuntimeException(message, cause);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,8 @@ class ColumnarBatchSuite extends SparkFunSuite {
// Over-allocating beyond MAX_CAPACITY throws an exception
column.appendBytes(10, 0.toByte)
}
assert(ex.getMessage.contains(s"Cannot reserve more than ${column.MAX_CAPACITY} bytes in " +
s"the vectorized reader"))
assert(ex.getMessage.contains(s"Cannot reserve additional contiguous bytes in the " +
s"vectorized reader"))
}
}
}