-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Document timestamp input limits #8369
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,6 +130,10 @@ fn string_to_timestamp_nanos_shim(s: &str) -> Result<i64> { | |
| } | ||
|
|
||
| /// to_timestamp SQL function | ||
| /// | ||
| /// Note: `to_timestamp` returns `Timestamp(Nanosecond)`. The supported range for integer input is between `-9223372037` and `9223372036`. | ||
| /// Supported range for string input is between `1677-09-21T00:12:44.0` and `2262-04-11T23:47:16.0`. | ||
| /// Please use `to_timestamp_seconds` for the input outside of supported bounds. | ||
| pub fn to_timestamp(args: &[ColumnarValue]) -> Result<ColumnarValue> { | ||
| handle::<TimestampNanosecondType, _, TimestampNanosecondType>( | ||
| args, | ||
|
|
@@ -157,6 +161,10 @@ pub fn to_timestamp_micros(args: &[ColumnarValue]) -> Result<ColumnarValue> { | |
| } | ||
|
|
||
| /// to_timestamp_nanos SQL function | ||
| /// | ||
| /// Note: `to_timestamp_nanos` returns `Timestamp(Nanosecond)`. The supported range for integer input is between `-9223372037` and `9223372036`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this doesn't seem right. I think the argument is treated as nanoseconds, so the range is really For example, this works just fine
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, you are right |
||
| /// Supported range for string input is between `1677-09-21T00:12:44.0` and `2262-04-11T23:47:16.0`. | ||
| /// Please use `to_timestamp_seconds` for the input outside of supported bounds. | ||
| pub fn to_timestamp_nanos(args: &[ColumnarValue]) -> Result<ColumnarValue> { | ||
| handle::<TimestampNanosecondType, _, TimestampNanosecondType>( | ||
| args, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1447,6 +1447,9 @@ Strings are parsed as RFC3339 (e.g. '2023-07-20T05:44:00') | |
| Integers and unsigned integers are interpreted as seconds since the unix epoch (`1970-01-01T00:00:00Z`) | ||
| return the corresponding timestamp. | ||
|
|
||
| Note: `to_timestamp` returns `Timestamp(Nanosecond)`. The supported range for integer input is between `-9223372037` and `9223372036`. | ||
| Supported range for string input is between `1677-09-21T00:12:44.0` and `2262-04-11T23:47:16.0`. Please use `to_timestamp_seconds` for the input outside of supported bounds. | ||
|
|
||
| ``` | ||
| to_timestamp(expression) | ||
| ``` | ||
|
|
@@ -1497,6 +1500,9 @@ return the corresponding timestamp. | |
| to_timestamp_nanos(expression) | ||
| ``` | ||
|
|
||
| Note: `to_timestamp_nanos` returns `Timestamp(Nanosecond)`. The supported range for integer input is between `-9223372037` and `9223372036`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| Supported range for string input is between `1677-09-21T00:12:44.0` and `2262-04-11T23:47:16.0`. Please use `to_timestamp_seconds` for the input outside of supported bounds. | ||
|
|
||
| #### Arguments | ||
|
|
||
| - **expression**: Expression to operate on. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.