This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 7703912b3e [improvement](error msg)improve the err msg returned when
the key not in columns when create table (#11490)
7703912b3e is described below
commit 7703912b3ecc69046c9990d724cd48f97886e29b
Author: zy-kkk <[email protected]>
AuthorDate: Thu Aug 4 11:20:49 2022 +0800
[improvement](error msg)improve the err msg returned when the key not in
columns when create table (#11490)
---
fe/fe-core/src/main/java/org/apache/doris/analysis/KeysDesc.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/KeysDesc.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/KeysDesc.java
index 3db8d07bc3..e853474971 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/KeysDesc.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/KeysDesc.java
@@ -71,6 +71,10 @@ public class KeysDesc implements Writable {
for (int i = 0; i < keysColumnNames.size(); ++i) {
String name = cols.get(i).getName();
if (!keysColumnNames.get(i).equalsIgnoreCase(name)) {
+ String keyName = keysColumnNames.get(i);
+ if (cols.stream().noneMatch(col ->
col.getName().equalsIgnoreCase(keyName))) {
+ throw new AnalysisException("Key column[" + keyName + "]
doesn't exist.");
+ }
throw new AnalysisException("Key columns should be a ordered
prefix of the schema.");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]