-
Notifications
You must be signed in to change notification settings - Fork 461
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
[VL] Support casting integral type to timestamp type #8593
base: main
Are you sure you want to change the base?
Conversation
Thanks for opening a pull request! Could you open an issue for this pull request on Github Issues? https://github.com/apache/incubator-gluten/issues Then could you also rename commit message and pull request title in the following format?
See also: |
} | ||
// Only support cast from date or integral type to timestamp. | ||
if (toType->kind() == TypeKind::TIMESTAMP) | ||
if (!input->type()->isDate()) { |
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.
We can still use one if
here, same as the original one if (toType->kind() == TypeKind::TIMESTAMP && !input->type()->isDate())
Run Gluten Clickhouse CI on x86 |
Run Gluten Clickhouse CI on x86 |
@@ -38,7 +38,25 @@ class GlutenParquetColumnIndexSuite extends ParquetColumnIndexSuite with GlutenS | |||
"cast(id as float) as _5", | |||
"cast(id as double) as _6", | |||
"cast(id as decimal(20,0)) as _7", | |||
"cast(cast(1618161925000 + id * 1000 * 60 * 60 * 24 as timestamp) as date) as _9" | |||
"cast(cast(1618161925 + id * 60 * 60 * 24 as timestamp) as date) as _9" |
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.
Why do we need this change here? Is it because larger timestamp will overflow in Velox? Could add some comments like "// Change 1618161925000 to 1618161925 because ... " for explanations?
Should we also update the cast functions support status? Seems like the current document is also outdated. Casting from date to timestamp is already supported. https://github.com/apache/incubator-gluten/blob/main/docs/velox-backend-support-progress.md#cast-functions-support-status |
What changes were proposed in this pull request?
There is a velox pr merged: facebookincubator/velox#11089. This pr fixes the fallback even though velox has supported such cast.
How was this patch tested?
Existing Spark tests.