wzx140 commented on code in PR #7003:
URL: https://github.com/apache/hudi/pull/7003#discussion_r1025423023


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/io/storage/HoodieSparkParquetReader.java:
##########
@@ -108,7 +117,12 @@ private ClosableIterator<InternalRow> 
getInternalRowIterator(Schema readerSchema
 
   @Override
   public Schema getSchema() {
-    return parquetUtils.readAvroSchema(conf, path);
+    // Some types in avro are not compatible with parquet
+    // decimal as int32/int64
+    MessageType messageType = ((ParquetUtils) parquetUtils).readSchema(conf, 
path);
+    StructType structType = new 
ParquetToSparkSchemaConverter(conf).convert(messageType);

Review Comment:
   Some types in avro are not compatible with parquet. For ex, decimal as 
int32/int64 in parquet will convert to int/long in avro. Because avro do not 
has decimal as int/long . We will lose the logic type info if we direct convert 
it to avro.



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to