parquet文件中的时间字段,在hive和spark-sql中读取正常,在impala中读取会偏移8个小时(少),经测试结果如下:
一 不修改impala配置
1 由spark或hive写入parquet
- spark和hive读取正常
- impala读取偏移8小时(少),需要手工偏移 from_unixtime(unix_timestamp(time) + 28800)
二 修改impala配置
use_local_tz_for_unix_timestamp_conversions=true
convert_legacy_hive_parquet_utc_timestamps=true
1 由spark或hive写入parquet
- spark和hive读取正常
- impala读取正常
2 由impala写入parquet
- spark和hive读取偏移8小时(多)
- impala读取正常
参考:https://docs.cloudera.com/documentation/enterprise/latest/topics/impala_timezone.html