PHILO-HE commented on code in PR #9563:
URL: https://github.com/apache/incubator-gluten/pull/9563#discussion_r2080954885
##########
cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc:
##########
@@ -224,16 +224,11 @@ bool
SubstraitToVeloxPlanValidator::validateScalarFunction(
}
bool isSupportedArrayCast(const TypePtr& fromType, const TypePtr& toType) {
- static const std::unordered_set<TypeKind> kAllowedArrayElementKinds = {
- TypeKind::DOUBLE,
- TypeKind::BOOLEAN,
- TypeKind::TIMESTAMP,
- };
-
// https://github.com/apache/incubator-gluten/issues/9392
// is currently WIP to add support for other types.
if (toType->isVarchar()) {
- return kAllowedArrayElementKinds.count(fromType->kind()) > 0;
+ return fromType->kind() == TypeKind::DOUBLE || fromType->kind() ==
TypeKind::BOOLEAN ||
+ fromType->kind() == TypeKind::TIMESTAMP;
Review Comment:
Change to isXXX(), e.g., fromType->isDouble(), for simplicity.
##########
cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc:
##########
@@ -242,6 +237,13 @@ bool isSupportedArrayCast(const TypePtr& fromType, const
TypePtr& toType) {
}
}
+ if (toType->isBoolean()) {
+ if (fromType->isTinyint() || fromType->isSmallint() ||
fromType->isInteger() || fromType->isBigint() ||
Review Comment:
`isInteger()` also returns true for Date type. And `isBigint()` also returns
true for ShortDecimal type. If they are not supported, please exclude these
cases by checking `isDate()` and `isShortDecimal()`.
--
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]