[GLUTEN-11622][VL] Support cast between TIMESTAMP and TIMESTAMP_NTZ - #12654
Conversation
|
Run Gluten Clickhouse CI on x86 |
787883d to
fcd4b69
Compare
|
Run Gluten Clickhouse CI on x86 |
fcd4b69 to
2501240
Compare
|
Run Gluten Clickhouse CI on x86 |
|
Hi @rui-mo, could you take a look when you get the chance? Thanks! |
| case Minute(child, _) => containsNTZ(child.dataType) | ||
| case Second(child, _) => containsNTZ(child.dataType) | ||
| case TimestampAdd(_, _, child, _) => containsNTZ(child.dataType) | ||
| case c: Cast if !containsNTZ(c.dataType) => containsNTZ(c.child.dataType) |
There was a problem hiding this comment.
This would allow all non-timestamp_ntz types to be cast to timestamp_ntz. While I assume the supported cases are still limited. Could you please confirm?
There was a problem hiding this comment.
Yes, that's correct fixed required both guards to check TimestampType
2501240 to
cce03eb
Compare
|
Run Gluten Clickhouse CI on x86 |
cce03eb to
554debc
Compare
|
Run Gluten Clickhouse CI on x86 |
|
@rui-mo could you take another look? Thank you! |
| case Minute(child, _) => containsNTZ(child.dataType) | ||
| case Second(child, _) => containsNTZ(child.dataType) | ||
| case TimestampAdd(_, _, child, _) => containsNTZ(child.dataType) | ||
| case c: Cast if c.dataType == TimestampType => containsNTZ(c.child.dataType) |
There was a problem hiding this comment.
The containsNTZ would also allow complex types which contain TimestampNTZ type, but those cases haven't been verified.
There was a problem hiding this comment.
Added a non-recursive isNTZ helper for the check, used in both Cast guards
| case Second(child, _) => containsNTZ(child.dataType) | ||
| case TimestampAdd(_, _, child, _) => containsNTZ(child.dataType) | ||
| case c: Cast if c.dataType == TimestampType => containsNTZ(c.child.dataType) | ||
| case c: Cast if containsNTZ(c.dataType) => c.child.dataType == TimestampType |
554debc to
660d7a0
Compare
|
Run Gluten Clickhouse CI on x86 |
|
Run Gluten Clickhouse CI on x86 |
be77bda to
a3c34aa
Compare
|
Run Gluten Clickhouse CI on x86 |
Enable CAST(timestamp AS timestamp_ntz) and CAST(timestamp_ntz AS timestamp)
to run natively in the Velox backend instead of falling back to Spark.
Velox PR: facebookincubator/velox#17920
Related issue: #11622