iemejia commented on code in PR #55932:
URL: https://github.com/apache/spark/pull/55932#discussion_r3912740685


##########
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedDeltaLengthByteArrayReader.java:
##########
@@ -58,7 +58,7 @@ public void readBinary(int total, WritableColumnVector c, int 
rowId) {
     ByteBufferOutputWriter outputWriter = 
ByteBufferOutputWriter::writeArrayByteBuffer;
     int length;
     for (int i = 0; i < total; i++) {
-      length = lengthsVector.getInt(currentRow + i);
+      length = checkLength(lengthsVector.getInt(currentRow + i));

Review Comment:
   Done — the three pre-existing catches (`:65`/`:97`/`:110`) now pass `e` into 
the `ParquetDecodingException`, matching the new `skipBinary` wrapper.



##########
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedDeltaLengthByteArrayReader.java:
##########
@@ -88,7 +88,7 @@ private void readGeoData(int total, WritableColumnVector c, 
int rowId, int srid,
     ByteBufferOutputWriter outputWriter = 
ByteBufferOutputWriter::writeArrayByteBuffer;
     int length;
     for (int i = 0; i < total; i++) {
-      length = lengthsVector.getInt(currentRow + i);
+      length = checkLength(lengthsVector.getInt(currentRow + i));

Review Comment:
   Added `readGeometry rejects a negative decoded length` in the DELTA_LENGTH 
suite: it reads a valid point first, then asserts the negative-length second 
value throws before `in.readNBytes` (which returns a short array rather than 
signalling truncation). Also added the equivalent case for the PLAIN geometry 
path, which had the same unguarded length.



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