diff --git a/c++/src/TypeImpl.cc b/c++/src/TypeImpl.cc index c7b073c713..cbc7b82796 100644 --- a/c++/src/TypeImpl.cc +++ b/c++/src/TypeImpl.cc @@ -660,7 +660,8 @@ namespace orc { std::pair nameRes = parseName(input, pos, end); pos = nameRes.second; if (input[pos] != ':') { - throw std::logic_error("Invalid struct type. No field name set."); + throw std::logic_error("Invalid struct type. Field name can not contain '" + + std::string(1, input[pos]) + "'."); } std::pair, size_t> typeRes = TypeImpl::parseType(input, ++pos, end); result->addStructField(nameRes.first, std::move(typeRes.first)); diff --git a/c++/test/TestType.cc b/c++/test/TestType.cc index c9ac2f2850..cec0d8d2c4 100644 --- a/c++/test/TestType.cc +++ b/c++/test/TestType.cc @@ -325,7 +325,7 @@ namespace orc { expectLogicErrorDuringParse("int<>", "Invalid < after int type."); expectLogicErrorDuringParse("array(int)", "Missing < after array."); expectLogicErrorDuringParse("struct>", - "Invalid struct type. No field name set."); + "Invalid struct type. Field name can not contain '<'."); expectLogicErrorDuringParse("struct", "Missing comma after field."); }