Skip to content

Commit

Permalink
Revert "address comments"
Browse files Browse the repository at this point in the history
This reverts commit 61fd55b.
  • Loading branch information
WangGuangxin committed Feb 27, 2024
1 parent 61fd55b commit cb8a1cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cpp/velox/substrait/SubstraitToVeloxExpr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,9 @@ std::shared_ptr<const core::ConstantTypedExpr> SubstraitVeloxExprConverter::toVe

ArrayVectorPtr SubstraitVeloxExprConverter::literalsToArrayVector(const ::substrait::Expression::Literal& literal) {
auto childSize = literal.list().values().size();
VELOX_USER_CHECK_GT(childSize, 0, "Expect a non-empty array literal");
if (childSize == 0) {
return makeEmptyArrayVector(pool_, UNKNOWN());
}
auto childTypeCase = literal.list().values(0).literal_type_case();
auto elementAtFunc = [&](vector_size_t idx) { return literal.list().values(idx); };
auto childVector = literalsToVector(childTypeCase, childSize, literal, elementAtFunc);
Expand All @@ -401,7 +403,9 @@ ArrayVectorPtr SubstraitVeloxExprConverter::literalsToArrayVector(const ::substr

MapVectorPtr SubstraitVeloxExprConverter::literalsToMapVector(const ::substrait::Expression::Literal& literal) {
auto childSize = literal.map().key_values().size();
VELOX_USER_CHECK_GT(childSize, 0, "Expect a non-empty map literal");
if (childSize == 0) {
return makeEmptyMapVector(pool_, UNKNOWN(), UNKNOWN());
}
auto keyTypeCase = literal.map().key_values(0).key().literal_type_case();
auto valueTypeCase = literal.map().key_values(0).value().literal_type_case();
auto keyAtFunc = [&](vector_size_t idx) { return literal.map().key_values(idx).key(); };
Expand Down

0 comments on commit cb8a1cb

Please sign in to comment.