-
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
Support timestamp(n) SQL type #13231
Support timestamp(n) SQL type #13231
Conversation
@@ -466,7 +467,14 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { | |||
// Timestamp Without Time zone | |||
None | |||
}; | |||
Ok(DataType::Timestamp(TimeUnit::Nanosecond, tz.map(Into::into))) | |||
let precision = match precision { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I assume this is the standard between vector api and precision?
I am currently working on a similar problem in the process of adapting Arrow in the Calcite community.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me -- thank you @findepi -- it will be amazing to be able to specify the timestamp precision via SQL
2020-09-08T13:42:29.190855123 | ||
|
||
query P rowsort | ||
SELECT CAST(ts AS timestamp(0)) FROM ts_data_nanos; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very cool 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. The Calcite Arrow adapter will also comply with this standard
Thanks again @findepi |
Relates to #13230