LuciferYang commented on code in PR #55853:
URL: https://github.com/apache/spark/pull/55853#discussion_r3246941663


##########
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/ParquetVectorUpdaterFactory.java:
##########
@@ -706,7 +706,13 @@ public void decodeSingleDictionaryId(
         WritableColumnVector values,
         WritableColumnVector dictionaryIds,
         Dictionary dictionary) {
-      values.putLong(offset, 
dictionary.decodeToLong(dictionaryIds.getDictId(offset)));
+      // Target is a 32-bit decimal column vector (precision <= 9); narrow the 
dictionary's
+      // long value to int via the same `(int) longValue` cast used by 
`readValue` and
+      // `readValues`. The pre-existing `putLong` here was a latent bug that 
did not surface
+      // until the dictionary-decode path was exercised by the new end-to-end 
test, because
+      // a 32-bit decimal vector stores values in `intData` and `putLong` 
would NPE on the
+      // unallocated `longData`.
+      values.putInt(offset, (int) 
dictionary.decodeToLong(dictionaryIds.getDictId(offset)));

Review Comment:
   done



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