PHILO-HE commented on code in PR #8743:
URL: https://github.com/apache/incubator-gluten/pull/8743#discussion_r1961228656
##########
cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc:
##########
@@ -269,46 +320,13 @@ bool SubstraitToVeloxPlanValidator::validateCast(
const auto& toType = SubstraitParser::parseType(castExpr.type());
core::TypedExprPtr input = exprConverter_->toVeloxExpr(castExpr.input(),
inputType);
- // Only support cast from date to timestamp
- if (toType->kind() == TypeKind::TIMESTAMP && !input->type()->isDate()) {
- LOG_VALIDATION_MSG(
- "Casting from " + input->type()->toString() + " to " +
toType->toString() + " is not supported.");
- return false;
- }
+ auto fromKind = input->type()->kind();
+ auto toKind = toType->kind();
- if (toType->isIntervalYearMonth()) {
- LOG_VALIDATION_MSG("Casting to " + toType->toString() + " is not
supported.");
+ if (SubstraitToVeloxPlanValidator::isDeniedCast(fromKind, toKind,
input->type(), toType)) {
Review Comment:
Since we can easily get fromKind & toKind from the other arguments (see
below), can we remove them from the argument list?
```
auto fromKind = input->type()->kind();
auto toKind = toType->kind();
```
--
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]