apache / drill

Apache Drill is a distributed MPP query layer for self describing data
https://drill.apache.org/
Apache License 2.0
1.92k stars 985 forks source link

Time zone issue #2916

Closed meicao2999 closed 2 weeks ago

meicao2999 commented 4 weeks ago

The time zone is Shanghai, and the data date queried by drill is 8 hours shorter. I see that the code is set to ZoneOffset UTC, Can it be set as a configurable parameter

jnturton commented 4 weeks ago

Drill date and time data types are "naive": they include no time zone information. Whatever time zone applied when the data was written is the only time zone in which they can be correctly understood when they're read again. There are date and time SQL functions that you can use to translate between time zones manually. You can use configuration to change the time zone Drill runs under [1], or change the OS clock time zone, but this will only affect Drill's understanding of the current date and time, e.g. as in select current_timestamp, not what it does with timestamps in your data.

  1. https://drill.apache.org/docs/data-type-conversion/#time-zone-limitation
meicao2999 commented 3 weeks ago

@jnturton Thank you. Based on your reminder, I have studied and understood the process