This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch orc
in repository https://gitbox.apache.org/repos/asf/doris-thirdparty.git
The following commit(s) were added to refs/heads/orc by this push:
new 903ea6ccdc [opt] better column name error description (#220)
903ea6ccdc is described below
commit 903ea6ccdc463b8a17af2604975107ba7d895380
Author: Jensen <[email protected]>
AuthorDate: Mon Jun 10 23:08:08 2024 +0800
[opt] better column name error description (#220)
cherry-pick from apache/orc#1954
---
c++/src/TypeImpl.cc | 3 ++-
c++/test/TestType.cc | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/c++/src/TypeImpl.cc b/c++/src/TypeImpl.cc
index 3f28dce30d..a570895192 100644
--- a/c++/src/TypeImpl.cc
+++ b/c++/src/TypeImpl.cc
@@ -688,7 +688,8 @@ namespace orc {
std::pair<std::string, size_t> 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<std::unique_ptr<Type>, 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 c1d7e360f5..6c8030dfb8 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<struct<bigint>>",
- "Invalid struct type. No field name set.");
+ "Invalid struct type. Field name can not
contain '<'.");
expectLogicErrorDuringParse("struct<a:bigint;b:string>", "Missing comma
after field.");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]