SourabhBadhya commented on code in PR #4498:
URL: https://github.com/apache/hive/pull/4498#discussion_r1270211190


##########
iceberg/iceberg-handler/src/test/results/positive/iceberg_timestamp_with_local_time_zone.q.out:
##########
@@ -0,0 +1,34 @@
+PREHOOK: query: create table ice_ts_4 (id int, ts timestamp with local time 
zone) stored by iceberg stored as parquet
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@ice_ts_4
+POSTHOOK: query: create table ice_ts_4 (id int, ts timestamp with local time 
zone) stored by iceberg stored as parquet
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@ice_ts_4
+PREHOOK: query: insert into ice_ts_4 values (1, cast('2023-07-20 00:00:00' as 
timestamp with local time zone))
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@ice_ts_4
+POSTHOOK: query: insert into ice_ts_4 values (1, cast('2023-07-20 00:00:00' as 
timestamp with local time zone))
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@ice_ts_4
+PREHOOK: query: select * from ice_ts_4
+PREHOOK: type: QUERY
+PREHOOK: Input: default@ice_ts_4
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: select * from ice_ts_4
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@ice_ts_4
+POSTHOOK: Output: hdfs://### HDFS PATH ###
+1      2023-07-20 00:00:00.0 US/Pacific
+PREHOOK: query: select * from ice_ts_4
+PREHOOK: type: QUERY
+PREHOOK: Input: default@ice_ts_4
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: select * from ice_ts_4
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@ice_ts_4
+POSTHOOK: Output: hdfs://### HDFS PATH ###
+1      2023-07-20 00:00:00.0 US/Pacific

Review Comment:
   IcebergTimestampWithLocalTimeZoneObjectInspector always uses the system 
default as the default time zone.
   Source - 
https://github.com/apache/hive/blob/bfa16dfb735060fd09e714a6fceb5635a3c28daa/iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/serde/objectinspector/IcebergTimestampWithZoneObjectInspectorHive3.java#L43
   
https://github.com/apache/hive/blob/bfa16dfb735060fd09e714a6fceb5635a3c28daa/serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/TypeInfoFactory.java#L72
   
   `set time zone Europe/Rome;`
   Timezone setting queries such as above rely on the config - 
`hive.local.time.zone`.
   Source - 
https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java#L390-L393
   The object inspector currently does not factor in this config hence the 
system default is used.
   
   Also implementing this is difficult since the object inspector is not aware 
of the conf object and we are constructing the 
IcebergTimestampWithLocalTimeZoneObjectInspector object through reflection.
   Source - 
https://github.com/apache/hive/blob/master/iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/serde/objectinspector/IcebergObjectInspector.java#L66-L69



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to