MaxGekk commented on code in PR #37852:
URL: https://github.com/apache/spark/pull/37852#discussion_r967979263
##########
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/codegen/UnsafeArrayWriter.java:
##########
@@ -55,10 +55,19 @@ public void initialize(int numElements) {
this.startingOffset = cursor();
+ long fixedPartInBytesLong =
+ ByteArrayMethods.roundNumberOfBytesToNearestWord((long) elementSize *
numElements);
+ long totalInitialSize = headerInBytes + fixedPartInBytesLong;
+
+ if (totalInitialSize > Integer.MAX_VALUE) {
+ throw new IllegalArgumentException(
Review Comment:
Is it possible to trigger the error from user space (from SQL for instance).
If so, please, introduce an error class and place it to error-classes.json.
--
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]