-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Incorrect result from cast(interval day to second as varchar) #9384
Labels
Comments
mbasmanova
added
bug
Something isn't working
triage
Newly created issue that needs attention.
correctness
labels
Apr 5, 2024
Presto's implementation:
|
Velox has IntervalDayTimeType::valueToString that can be used to implement cast to varchar. |
mbasmanova
added a commit
to mbasmanova/velox-1
that referenced
this issue
Apr 5, 2024
Summary: CAST expression used to handle INTERVAL DAY TO SECOND values as BIGINT. This allowed invalid casts (e.g. from varchar, to double, etc.) and produced incorrect results when casting to varchar. Casting 1 second interval used to return '1000' instead of '0 00:00:01.000'. Fixes facebookincubator#9384 Differential Revision: D55796600
mbasmanova
added a commit
to mbasmanova/velox-1
that referenced
this issue
Apr 5, 2024
Summary: CAST expression used to handle INTERVAL DAY TO SECOND values as BIGINT. This allowed invalid casts (e.g. from varchar, to double, etc.) and produced incorrect results when casting to varchar. Casting 1 second interval used to return '1000' instead of '0 00:00:01.000'. Fixes facebookincubator#9384 Differential Revision: D55796600
mbasmanova
added a commit
to mbasmanova/velox-1
that referenced
this issue
Apr 5, 2024
Summary: CAST expression used to handle INTERVAL DAY TO SECOND values as BIGINT. This allowed invalid casts (e.g. from varchar, to double, etc.) and produced incorrect results when casting to varchar. Casting 1 second interval used to return '1000' instead of '0 00:00:01.000'. Fixes facebookincubator#9384 Differential Revision: D55796600
mbasmanova
added a commit
to mbasmanova/velox-1
that referenced
this issue
Apr 5, 2024
Summary: CAST expression used to handle INTERVAL DAY TO SECOND values as BIGINT. This allowed invalid casts (e.g. from varchar, to double, etc.) and produced incorrect results when casting to varchar. Casting 1 second interval used to return '1000' instead of '0 00:00:01.000'. Fixes facebookincubator#9384 Differential Revision: D55796600
mbasmanova
added a commit
to mbasmanova/velox-1
that referenced
this issue
Apr 5, 2024
Summary: CAST expression used to handle INTERVAL DAY TO SECOND values as BIGINT. This allowed invalid casts (e.g. from varchar, to double, etc.) and produced incorrect results when casting to varchar. Casting 1 second interval used to return '1000' instead of '0 00:00:01.000'. Fixes facebookincubator#9384 Reviewed By: xiaoxmeng Differential Revision: D55796600
mbasmanova
added a commit
to mbasmanova/velox-1
that referenced
this issue
Apr 5, 2024
Summary: CAST expression used to handle INTERVAL DAY TO SECOND values as BIGINT. This allowed invalid casts (e.g. from varchar, to double, etc.) and produced incorrect results when casting to varchar. Casting 1 second interval used to return '1000' instead of '0 00:00:01.000'. Fixes facebookincubator#9384 Reviewed By: xiaoxmeng Differential Revision: D55796600
Joe-Abraham
pushed a commit
to Joe-Abraham/velox
that referenced
this issue
Jun 7, 2024
Summary: Pull Request resolved: facebookincubator#9386 CAST expression used to handle INTERVAL DAY TO SECOND values as BIGINT. This allowed invalid casts (e.g. from varchar, to double, etc.) and produced incorrect results when casting to varchar. Casting 1 second interval used to return '1000' instead of '0 00:00:01.000'. Fixes facebookincubator#9384 Reviewed By: xiaoxmeng Differential Revision: D55796600 fbshipit-source-id: 3d51a8eb18b434315bf9285f58b8f2cdbedca63d
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug description
Velox seems to handle 'interval day to second' as an integer when casting to 'varchar'. That produces incorrect results.
For example, casting 1 day interval to varchar should return '1 00:00:00.000' but Velox returns '1'.
Velox repro:
CC: @amitkdutta @kagamiori @kgpai @svm1 @aditi-pandit
System information
n/a
Relevant logs
No response
The text was updated successfully, but these errors were encountered: