vectorijk commented on code in PR #13035:
URL: https://github.com/apache/gluten/pull/13035#discussion_r4429652304
##########
cpp/velox/substrait/SubstraitToVeloxExpr.cc:
##########
@@ -498,37 +521,52 @@ VectorPtr SubstraitVeloxExprConverter::literalsToVector(
vector_size_t childSize,
std::function<::substrait::Expression::Literal(vector_size_t /* idx */)>
elementAtFunc) {
auto childTypeCase = childLiteral.literal_type_case();
- switch (childTypeCase) {
- case ::substrait::Expression_Literal::LiteralTypeCase::kNull: {
- auto veloxType = SubstraitParser::parseType(childLiteral.null());
- auto kind = veloxType->kind();
- return VELOX_DYNAMIC_SCALAR_TYPE_DISPATCH_ALL(
- constructFlatVector, kind, elementAtFunc, childSize, veloxType,
pool_);
+ auto child = elementAtFunc(0);
+ if (child.has_null()) {
+ auto nullType = SubstraitParser::parseType(child.null());
+ if (nullType) {
+ switch (nullType->kind()) {
+ case TypeKind::ARRAY:
+ childTypeCase =
::substrait::Expression_Literal::LiteralTypeCase::kList;
+ break;
+ case TypeKind::ROW:
+ childTypeCase =
::substrait::Expression_Literal::LiteralTypeCase::kStruct;
+ break;
+ case TypeKind::MAP:
+ childTypeCase =
::substrait::Expression_Literal::LiteralTypeCase::kMap;
+ break;
+ default:
+ break;
+ }
}
+ }
+ switch (childTypeCase) {
case
::substrait::Expression_Literal::LiteralTypeCase::kIntervalDayToSecond:
return constructFlatVector<TypeKind::BIGINT>(elementAtFunc, childSize,
INTERVAL_DAY_TIME(), pool_);
// Handle EmptyList and List together since the children could be either
case.
case ::substrait::Expression_Literal::LiteralTypeCase::kEmptyList:
- case ::substrait::Expression_Literal::LiteralTypeCase::kList: {
- ArrayVectorPtr elements;
+ case ::substrait::Expression_Literal::LiteralTypeCase::kList: {
Review Comment:
Nice. Fixed this format check
--
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]