ashokraminedi commented on code in PR #20130:
URL: https://github.com/apache/hudi/pull/20130#discussion_r4137835132


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/utils/SparkInternalSchemaConverter.java:
##########
@@ -349,9 +349,13 @@ private static boolean 
convertIntLongType(WritableColumnVector oldV, WritableCol
         } else if (newType instanceof StringType) {
           newV.putByteArray(i, getUTF8Bytes((isInt ? oldV.getInt(i) : 
oldV.getLong(i)) + ""));
         } else if (newType instanceof DecimalType) {
+          DecimalType decimalType = (DecimalType) newType;

Review Comment:
   Agreed, this is useful to pin the converter behavior independently of Spark 
SQL.
   
   Added `testDecimalPrecisionOverflow` in `TestSparkInternalSchemaConverter` 
in `889b09ac6c27`. It calls `convertColumnVectorType` directly with 
`OnHeapColumnVector`s and covers INT, LONG, FLOAT, DOUBLE, and STRING -> 
`DECIMAL(4, 2)` overflow, asserting that each produces NULL with ANSI disabled.
   
   This gives the affected conversion paths direct coverage without a Spark SQL 
or version guard.



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

Reply via email to