diff --git a/cpp/velox/substrait/VeloxSubstraitSignature.cc b/cpp/velox/substrait/VeloxSubstraitSignature.cc index a7d59c20cc96b..34e0df6de2fdb 100644 --- a/cpp/velox/substrait/VeloxSubstraitSignature.cc +++ b/cpp/velox/substrait/VeloxSubstraitSignature.cc @@ -172,10 +172,9 @@ TypePtr VeloxSubstraitSignature::fromSubstraitSignature(const std::string& signa if (startWith(signature, "struct")) { // Struct type name is in the format of struct. auto types = parseNestedTypeSignature(signature); - std::vector names; - names.resize(types.size()); + std::vector names(types.size()); for (int i = 0; i < types.size(); i++) { - names.emplace_back(""); + names[i] = ""; } return std::make_shared(std::move(names), std::move(types)); }