-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change coerced type for comparison between timestamp with date to timestamp #4761
Comments
I agree we should coerce Date --> Timestamp rather than Timestamp -> Date This will ensure that no data is truncated during coercion, consistent with the rest of the rules Date to Timestamp is lossless, However, going from Timestamp --> Date would truncate the precision of the original timestamp:
|
@alamb @liukun4515 I can take this ticket |
Yes I think that is a good assumption |
we have the |
It's better to do the investigation about the date/timestamp and timezone before coding. |
@liukun4515 reg to postgres the conversion happens through timestamp, opposite to spark
Edit: this is for string literal for date it is
|
Thanks for your effort for that, but I need some time to investigate time/data in PG and spark. I will reply and summary the behavior of them in a few days. |
Thanks @liukun4515, I can take some part of investigations if you share whats your plan. There is a an internal cast table which registers type_from, type_to, cast_function. But these casts registered for timestamptz -> date, and opposite date -> timestamptz. Some helpful queries below:
|
@liukun4515 another query in PG I believe give some clue
That presumes the cast happens through timestamp as you and @alamb deducted. The same behaviour in spark
let me know if you think its enough to make a PR |
Waiting apache/arrow-rs#3584 |
can you point out the issue or the pr depended in the arrow-rs? |
#5140 is local PR waiting for my changes in arrow-rs to support date to ts cast. Now its done and timestamp and date can be coerced having timestamp as a common type, the same as PG or Spark does |
cc @comphead @alamb
But current implementation of coerced type is date, we can fix this in the follow up PR.
Originally posted by @liukun4515 in #4741 (comment)
The text was updated successfully, but these errors were encountered: