xicm commented on code in PR #8888:
URL: https://github.com/apache/hudi/pull/8888#discussion_r1218809807


##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/avro/HoodieAvroParquetReader.java:
##########
@@ -90,7 +83,7 @@ public Void getCurrentKey() throws IOException, 
InterruptedException {
   @Override
   public ArrayWritable getCurrentValue() throws IOException, 
InterruptedException {
     GenericRecord record = parquetRecordReader.getCurrentValue();
-    return (ArrayWritable) 
HoodieRealtimeRecordReaderUtils.avroToArrayWritable(record, baseSchema, true);
+    return (ArrayWritable) 
HoodieRealtimeRecordReaderUtils.avroToArrayWritable(record, record.getSchema(), 
true);

Review Comment:
   could you try the case described in #6741, and `select col7 ` a timestamp 
field.
   
   ```
   +----------------------------------------------------+
   |                   createtab_stmt                   |
   +----------------------------------------------------+
   | CREATE EXTERNAL TABLE `tx_null_ro`(                |
   |   `_hoodie_commit_time` string COMMENT '',         |
   |   `_hoodie_commit_seqno` string COMMENT '',        |
   |   `_hoodie_record_key` string COMMENT '',          |
   |   `_hoodie_partition_path` string COMMENT '',      |
   |   `_hoodie_file_name` string COMMENT '',           |
   |   `id` int COMMENT '',                             |
   |   `comb` int COMMENT '',                           |
   |   `col0` int COMMENT '',                           |
   |   `col1` bigint COMMENT '',                        |
   |   `col2` float COMMENT '',                         |
   |   `col3` double COMMENT '',                        |
   |   `col4` decimal(10,4) COMMENT '',                 |
   |   `col5` string COMMENT '',                        |
   |   `col6` date COMMENT '',                          |
   |   `col7` timestamp COMMENT '',                     |
   |   `col8` boolean COMMENT '',                       |
   |   `col9` binary COMMENT '')                        |
   | PARTITIONED BY (                                   |
   |   `par` date COMMENT '')                           |
   | ROW FORMAT SERDE                                   |
   |   'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'  |
   | WITH SERDEPROPERTIES (                             |
   |   'hoodie.query.as.ro.table'='true',               |
   |   'path'='hdfs://host-10-19-37-160:8020/tmp/hoodie/tx_null')  |
   | STORED AS INPUTFORMAT                              |
   |   'org.apache.hudi.hadoop.HoodieParquetInputFormat'  |
   | OUTPUTFORMAT                                       |
   |   'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat' |
   | LOCATION                                           |
   |   'hdfs://host-10-19-37-160:8020/tmp/hoodie/tx_null' |
   | TBLPROPERTIES (                                    |
   |   'last_commit_time_sync'='20230606105859812',     |
   |   'spark.sql.create.version'='3.1.1',              |
   |   'spark.sql.sources.provider'='hudi',             |
   |   'spark.sql.sources.schema.numPartCols'='1',      |
   |   'spark.sql.sources.schema.numParts'='1',         |
   |   
'spark.sql.sources.schema.part.0'='{"type":"struct","fields":[{"name":"_hoodie_commit_time","type":"string","nullable":true,"metadata":{}},{"name":"_hoodie_commit_seqno","type":"string","nullable":true,"metadata":{}},{"name":"_hoodie_record_key","type":"string","nullable":true,"metadata":{}},{"name":"_hoodie_partition_path","type":"string","nullable":true,"metadata":{}},{"name":"_hoodie_file_name","type":"string","nullable":true,"metadata":{}},{"name":"id","type":"integer","nullable":true,"metadata":{}},{"name":"comb","type":"integer","nullable":true,"metadata":{}},{"name":"col0","type":"integer","nullable":true,"metadata":{}},{"name":"col1","type":"long","nullable":true,"metadata":{}},{"name":"col2","type":"float","nullable":true,"metadata":{}},{"name":"col3","type":"double","nullable":true,"metadata":{}},{"name":"col4","type":"decimal(10,4)","nullable":true,"metadata":{}},{"name":"col5","type":"string","nullable":true,"metadata":{}},{"name":"col6","type":"date","nullable":tr
 
ue,"metadata":{}},{"name":"col7","type":"timestamp","nullable":true,"metadata":{}},{"name":"col8","type":"boolean","nullable":true,"metadata":{}},{"name":"col9","type":"binary","nullable":true,"metadata":{}},{"name":"par","type":"date","nullable":true,"metadata":{}}]}',
  |
   |   'spark.sql.sources.schema.partCol.0'='par',      |
   |   'transient_lastDdlTime'='1686020373')            |
   +----------------------------------------------------+
   ```
   
   
![image](https://github.com/apache/hudi/assets/36392121/dc5d1818-6a2e-4d49-b622-7ea30a73af29)
   
   my hive version 3.1.2



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