Re: [PR] [VL] Support Cast from VARCHAR to TIMESTAMP_NTZ [gluten]
github-actions[bot] commented on PR #12656: URL: https://github.com/apache/gluten/pull/12656#issuecomment-5424545417 Run Gluten Clickhouse CI on x86 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] [VL] Support Cast from VARCHAR to TIMESTAMP_NTZ [gluten]
Mariamalmesfer commented on code in PR #12656:
URL: https://github.com/apache/gluten/pull/12656#discussion_r3862197291
##
gluten-substrait/src/main/scala/org/apache/gluten/extension/columnar/validator/Validators.scala:
##
@@ -284,7 +284,9 @@ object Validators {
case Second(child, _) => containsNTZ(child.dataType)
case TimestampAdd(_, _, child, _) =>
containsNTZ(child.dataType)
case c: Cast if c.dataType == TimestampType =>
isNTZ(c.child.dataType)
- case c: Cast if isNTZ(c.dataType) => c.child.dataType ==
TimestampType
+ case c: Cast if c.dataType == StringType =>
isNTZ(c.child.dataType)
+ case c: Cast if isNTZ(c.dataType) =>
+c.child.dataType == TimestampType || c.child.dataType ==
StringType
Review Comment:
done, replaced the three cases with a single passthrough so the pipeline
reaches `isAllowedCast`, which handles the actual validation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] [VL] Support Cast from VARCHAR to TIMESTAMP_NTZ [gluten]
rui-mo commented on code in PR #12656:
URL: https://github.com/apache/gluten/pull/12656#discussion_r3854278030
##
gluten-substrait/src/main/scala/org/apache/gluten/extension/columnar/validator/Validators.scala:
##
@@ -284,7 +284,9 @@ object Validators {
case Second(child, _) => containsNTZ(child.dataType)
case TimestampAdd(_, _, child, _) =>
containsNTZ(child.dataType)
case c: Cast if c.dataType == TimestampType =>
isNTZ(c.child.dataType)
- case c: Cast if isNTZ(c.dataType) => c.child.dataType ==
TimestampType
+ case c: Cast if c.dataType == StringType =>
isNTZ(c.child.dataType)
+ case c: Cast if isNTZ(c.dataType) =>
+c.child.dataType == TimestampType || c.child.dataType ==
StringType
Review Comment:
I assume we won't need the additional validation on the Scala side if we
move these checks into `isAllowedCast`. They serve the same purpose: validating
the plan before execution and falling back when the cast is unsupported.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] [VL] Support Cast from VARCHAR to TIMESTAMP_NTZ [gluten]
Mariamalmesfer commented on code in PR #12656:
URL: https://github.com/apache/gluten/pull/12656#discussion_r3847198732
##
gluten-substrait/src/main/scala/org/apache/gluten/extension/columnar/validator/Validators.scala:
##
@@ -284,7 +284,9 @@ object Validators {
case Second(child, _) => containsNTZ(child.dataType)
case TimestampAdd(_, _, child, _) =>
containsNTZ(child.dataType)
case c: Cast if c.dataType == TimestampType =>
isNTZ(c.child.dataType)
- case c: Cast if isNTZ(c.dataType) => c.child.dataType ==
TimestampType
+ case c: Cast if c.dataType == StringType =>
isNTZ(c.child.dataType)
+ case c: Cast if isNTZ(c.dataType) =>
+c.child.dataType == TimestampType || c.child.dataType ==
StringType
Review Comment:
Thanks, removing the three cases with nothing in place would break NTZ casts
entirely, since this file short circuits before isAllowedCast runs
Did you mean this instead?
`case c: Cast if isNTZ(c.dataType) || isNTZ(c.child.dataType) => true`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] [VL] Support Cast from VARCHAR to TIMESTAMP_NTZ [gluten]
Mariamalmesfer commented on code in PR #12656:
URL: https://github.com/apache/gluten/pull/12656#discussion_r3847198732
##
gluten-substrait/src/main/scala/org/apache/gluten/extension/columnar/validator/Validators.scala:
##
@@ -284,7 +284,9 @@ object Validators {
case Second(child, _) => containsNTZ(child.dataType)
case TimestampAdd(_, _, child, _) =>
containsNTZ(child.dataType)
case c: Cast if c.dataType == TimestampType =>
isNTZ(c.child.dataType)
- case c: Cast if isNTZ(c.dataType) => c.child.dataType ==
TimestampType
+ case c: Cast if c.dataType == StringType =>
isNTZ(c.child.dataType)
+ case c: Cast if isNTZ(c.dataType) =>
+c.child.dataType == TimestampType || c.child.dataType ==
StringType
Review Comment:
Thanks، removing the three cases with nothing in place would break NTZ casts
entirely, since this file short circuits before isAllowedCast runs
Did you mean this instead?
`case c: Cast if isNTZ(c.dataType) || isNTZ(c.child.dataType) => true`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] [VL] Support Cast from VARCHAR to TIMESTAMP_NTZ [gluten]
Mariamalmesfer commented on code in PR #12656:
URL: https://github.com/apache/gluten/pull/12656#discussion_r3847198732
##
gluten-substrait/src/main/scala/org/apache/gluten/extension/columnar/validator/Validators.scala:
##
@@ -284,7 +284,9 @@ object Validators {
case Second(child, _) => containsNTZ(child.dataType)
case TimestampAdd(_, _, child, _) =>
containsNTZ(child.dataType)
case c: Cast if c.dataType == TimestampType =>
isNTZ(c.child.dataType)
- case c: Cast if isNTZ(c.dataType) => c.child.dataType ==
TimestampType
+ case c: Cast if c.dataType == StringType =>
isNTZ(c.child.dataType)
+ case c: Cast if isNTZ(c.dataType) =>
+c.child.dataType == TimestampType || c.child.dataType ==
StringType
Review Comment:
Thanks، but removing the three cases with nothing in place would break NTZ
casts entirely, since this file short circuits before isAllowedCast runs
Did you mean this instead?
`case c: Cast if isNTZ(c.dataType) || isNTZ(c.child.dataType) => true`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] [VL] Support Cast from VARCHAR to TIMESTAMP_NTZ [gluten]
rui-mo commented on code in PR #12656:
URL: https://github.com/apache/gluten/pull/12656#discussion_r3846864415
##
gluten-substrait/src/main/scala/org/apache/gluten/extension/columnar/validator/Validators.scala:
##
@@ -284,7 +284,9 @@ object Validators {
case Second(child, _) => containsNTZ(child.dataType)
case TimestampAdd(_, _, child, _) =>
containsNTZ(child.dataType)
case c: Cast if c.dataType == TimestampType =>
isNTZ(c.child.dataType)
- case c: Cast if isNTZ(c.dataType) => c.child.dataType ==
TimestampType
+ case c: Cast if c.dataType == StringType =>
isNTZ(c.child.dataType)
+ case c: Cast if isNTZ(c.dataType) =>
+c.child.dataType == TimestampType || c.child.dataType ==
StringType
Review Comment:
Given that we already have native validation for casts, can we remove all
the casts validation here?
```
SubstraitToVeloxPlanValidator::isAllowedCast
```
##
cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc:
##
@@ -303,7 +303,10 @@ bool SubstraitToVeloxPlanValidator::isAllowedCast(const
TypePtr& fromType, const
return false;
}
if (toType->equivalent(*TIMESTAMP_UTC())) {
-// Only supports from Timestamp to TimestampNTZ.
+// Only supports from Timestamp or Varchar to TimestampNTZ.
Review Comment:
nit: remove this comment, as the code is clear enough.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] [VL] Support Cast from VARCHAR to TIMESTAMP_NTZ [gluten]
Mariamalmesfer commented on PR #12656: URL: https://github.com/apache/gluten/pull/12656#issuecomment-5399986121 Hi @rui-mo, could you take a look at this PR when you get a chance? thanks -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] [VL] Support Cast from VARCHAR to TIMESTAMP_NTZ [gluten]
github-actions[bot] commented on PR #12656: URL: https://github.com/apache/gluten/pull/12656#issuecomment-5359076187 Run Gluten Clickhouse CI on x86 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] [VL] Support Cast from VARCHAR to TIMESTAMP_NTZ [gluten]
github-actions[bot] commented on PR #12656: URL: https://github.com/apache/gluten/pull/12656#issuecomment-5347135825 Run Gluten Clickhouse CI on x86 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] [VL] Support Cast from VARCHAR to TIMESTAMP_NTZ [gluten]
github-actions[bot] commented on PR #12656: URL: https://github.com/apache/gluten/pull/12656#issuecomment-5330513235 Run Gluten Clickhouse CI on x86 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[PR] [VL] Support Cast from VARCHAR to TIMESTAMP_NTZ [gluten]
Mariamalmesfer opened a new pull request, #12656: URL: https://github.com/apache/gluten/pull/12656 (no comment) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
