From 74a3d966ec6cfadb104e38fd2681b1b1add5be66 Mon Sep 17 00:00:00 2001 From: "wangguangxin.cn" Date: Thu, 21 Mar 2024 00:17:47 +0800 Subject: [PATCH] Revert "address comments" This reverts commit 854582618ab55206ab0953492521ea275a9d69bb. --- cpp/velox/substrait/VeloxSubstraitSignature.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/cpp/velox/substrait/VeloxSubstraitSignature.cc b/cpp/velox/substrait/VeloxSubstraitSignature.cc index 37c65843f3b8..34e0df6de2fd 100644 --- a/cpp/velox/substrait/VeloxSubstraitSignature.cc +++ b/cpp/velox/substrait/VeloxSubstraitSignature.cc @@ -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. - 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); }