voonhous commented on code in PR #20760:
URL: https://github.com/apache/hudi/pull/20760#discussion_r4662778972


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/io/storage/row/HoodieRowParquetWriteSupport.java:
##########
@@ -789,9 +791,11 @@ private Type convertField(HoodieSchema fieldSchema, 
StructField structField, Typ
     } else if (dataType == DataTypes.DateType) {
       return Types.primitive(INT32, repetition)
           .as(LogicalTypeAnnotation.dateType()).named(structField.name());
-    } else if (dataType == DataTypes.ShortType) {
-      return Types.primitive(INT32, repetition)
-          .as(LogicalTypeAnnotation.intType(16, 
true)).named(structField.name());
+    } else if (dataType == DataTypes.ByteType || dataType == 
DataTypes.ShortType) {
+      // Plain INT32 without an INT(8) / INT(16) annotation: the table schema 
has no 8- or 16-bit
+      // integer type and records these columns as int, which is what every 
other write path writes

Review Comment:
   Fixed, scoped both comments to the other Spark write paths, and the reader 
and column stats comments now call out Flink's RowData writers.



##########
hudi-common/src/test/java/org/apache/hudi/metadata/stats/TestValueType.java:
##########
@@ -252,6 +253,26 @@ public void testFromParquetPrimitiveType() {
     assertEquals(ValueType.DOUBLE, 
valueTypeFor(PrimitiveType.PrimitiveTypeName.DOUBLE));
   }
 
+  @Test
+  public void testFromParquetIntegerAnnotations() {

Review Comment:
   Added `testOriginalTypeAdapterIntegerAnnotations` in `TestValueType`, which 
asserts against `OriginalTypeParquetAdapter` directly.



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