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:
   Scoped both comments to the other Spark write paths. 
`ParquetSchemaConverter` still has the INT(8)/INT(16) branches, but since 1.2.1 
the Flink write support builds the Parquet schema from `HoodieSchema`, which 
collapses TINYINT/SMALLINT to INT, so Flink writes plain INT32. Flink's 
bulk_insert and append writers did write INT(8)/INT(16) up to 1.2.0, which is 
what the reader and column stats comments now say.
   



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