Skip to content

Commit

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

ArrayVectorPtr SubstraitVeloxExprConverter::literalsToArrayVector(const ::substrait::Expression::Literal& literal) {
auto childSize = literal.list().values().size();
if (childSize == 0) {
// childSize == 0 should not happend here but just for integrity check
return makeEmptyArrayVector(pool_, UNKNOWN());
}
VELOX_USER_CHECK_GT(childSize, 0, "Expect a non-empty array literal");
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 @@ -404,10 +401,7 @@ ArrayVectorPtr SubstraitVeloxExprConverter::literalsToArrayVector(const ::substr

MapVectorPtr SubstraitVeloxExprConverter::literalsToMapVector(const ::substrait::Expression::Literal& literal) {
auto childSize = literal.map().key_values().size();
if (childSize == 0) {
// childSize == 0 should not happend here but just for integrity check
return makeEmptyMapVector(pool_, UNKNOWN(), UNKNOWN());
}
VELOX_USER_CHECK_GT(childSize, 0, "Expect a non-empty map literal");
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 61fd55b

Please sign in to comment.