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]