Skip to content

Commit

Permalink
Revert "address comments"
Browse files Browse the repository at this point in the history
This reverts commit 8545826.
  • Loading branch information
WangGuangxin committed Mar 20, 2024
1 parent 8545826 commit 74a3d96
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions cpp/velox/substrait/VeloxSubstraitSignature.cc
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,19 @@ TypePtr VeloxSubstraitSignature::fromSubstraitSignature(const std::string& signa
if (types.size() != 2) {
VELOX_UNSUPPORTED("Substrait type signature conversion to Velox type not supported for {}.", signature);
}
return MAP(types[0], types[1]);
return MAP(std::move(types)[0], std::move(types)[1]);
}

if (startWith(signature, "list")) {
// List type name is in the format of list<T>.
auto types = parseNestedTypeSignature(signature);
if (types.size() != 1) {
VELOX_UNSUPPORTED("Substrait type signature conversion to Velox type not supported for {}.", signature);
}
auto elementType = types[0];
auto listStart = signature.find_first_of('<');
auto listEnd = signature.find_last_of('>');
VELOX_CHECK(
listEnd - listStart > 1,
"Native validation failed due to: more information is needed to create ListType: {}",
signature);

auto elementTypeStr = signature.substr(listStart + 1, listEnd - listStart - 1);
auto elementType = fromSubstraitSignature(elementTypeStr);
return ARRAY(elementType);
}

Expand Down

0 comments on commit 74a3d96

Please sign in to comment.