This is an automated email from the ASF dual-hosted git repository.
morrysnow 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 87d36d0ffa5 [opt](Nereids)when both Nereids and old parsers report
errors, prompt error messages for the Nereids (#28580)
87d36d0ffa5 is described below
commit 87d36d0ffa5026b8f5c5c654d32e8a840e3308cf
Author: zhangdong <[email protected]>
AuthorDate: Tue Dec 19 12:04:08 2023 +0800
[opt](Nereids)when both Nereids and old parsers report errors, prompt error
messages for the Nereids (#28580)
---
.../src/main/java/org/apache/doris/qe/ConnectProcessor.java | 9 ++++++++-
.../suites/correctness_p0/test_current_timestamp.groovy | 2 +-
regression-test/suites/datatype_p0/bitmap/test_bitmap_int.groovy | 2 +-
.../query/test_nestedtypes_insert_into_select.groovy | 2 +-
regression-test/suites/demo_p0/test_action.groovy | 2 +-
.../insert_into_table/update_on_current_timestamp.groovy | 2 +-
regression-test/suites/query_p0/join/test_join2.groovy | 2 +-
7 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java
b/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java
index ada19e407d3..3fe4457ba5a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java
@@ -182,7 +182,7 @@ public abstract class ConnectProcessor {
.setSqlHash(ctx.getSqlHash());
List<StatementBase> stmts = null;
-
+ Exception nereidsParseException = null;
// Nereids do not support prepare and execute now, so forbid prepare
command, only process query command
if (mysqlCommand == MysqlCommand.COM_QUERY &&
ctx.getSessionVariable().isEnableNereidsPlanner()) {
try {
@@ -195,6 +195,7 @@ public abstract class ConnectProcessor {
// TODO: We should catch all exception here until we support
all query syntax.
LOG.debug("Nereids parse sql failed. Reason: {}. Statement:
\"{}\".",
e.getMessage(), convertedStmt);
+ nereidsParseException = e;
}
}
@@ -203,6 +204,12 @@ public abstract class ConnectProcessor {
try {
stmts = parse(convertedStmt);
} catch (Throwable throwable) {
+ // if NereidsParser and oldParser both failed,
+ // prove is a new feature implemented only on the nereids,
+ // so an error message for the new nereids is thrown
+ if (nereidsParseException != null) {
+ throwable = nereidsParseException;
+ }
// Parse sql failed, audit it and return
handleQueryException(throwable, convertedStmt, null, null);
return;
diff --git
a/regression-test/suites/correctness_p0/test_current_timestamp.groovy
b/regression-test/suites/correctness_p0/test_current_timestamp.groovy
index 6471f866169..f1ec942356f 100644
--- a/regression-test/suites/correctness_p0/test_current_timestamp.groovy
+++ b/regression-test/suites/correctness_p0/test_current_timestamp.groovy
@@ -213,7 +213,7 @@ suite("test_current_timestamp") {
DISTRIBUTED BY HASH(id)
PROPERTIES("replication_num" = "1");
"""
- exception "errCode = 2, detailMessage = Internal Error, maybe syntax
error or this is a bug: column's default value current_timestamp precision must
be between 0 and 6"
+ exception "between 0 and 6"
}
// user case
diff --git a/regression-test/suites/datatype_p0/bitmap/test_bitmap_int.groovy
b/regression-test/suites/datatype_p0/bitmap/test_bitmap_int.groovy
index 0b0d577d197..0c620790e06 100644
--- a/regression-test/suites/datatype_p0/bitmap/test_bitmap_int.groovy
+++ b/regression-test/suites/datatype_p0/bitmap/test_bitmap_int.groovy
@@ -68,7 +68,7 @@ suite("test_bitmap_int") {
test {
sql """SELECT case id_bitmap when 1 then 1 else 0 FROM test_bitmap;"""
- exception "errCode"
+ exception "ParseException"
}
qt_sql64_4 """SELECT id_bitmap FROM test_bitmap WHERE id_bitmap is null
LIMIT 20;"""
diff --git
a/regression-test/suites/datatype_p0/nested_types/query/test_nestedtypes_insert_into_select.groovy
b/regression-test/suites/datatype_p0/nested_types/query/test_nestedtypes_insert_into_select.groovy
index 3efb9d5b06f..a74687af64e 100644
---
a/regression-test/suites/datatype_p0/nested_types/query/test_nestedtypes_insert_into_select.groovy
+++
b/regression-test/suites/datatype_p0/nested_types/query/test_nestedtypes_insert_into_select.groovy
@@ -53,6 +53,6 @@ suite("test_nestedtypes_insert_into_select", "p0") {
test {
sql "insert into ast values ('text' ,
[named_struct('a',1,'b','home'),named_struct('a',2,'b','work')]);"
- exception "errCode = 2, detailMessage = Sql parser can't convert the
result to array, please check your sql."
+ exception "ParseException"
}
}
diff --git a/regression-test/suites/demo_p0/test_action.groovy
b/regression-test/suites/demo_p0/test_action.groovy
index 8a2d415e7ff..db5de0229b8 100644
--- a/regression-test/suites/demo_p0/test_action.groovy
+++ b/regression-test/suites/demo_p0/test_action.groovy
@@ -19,7 +19,7 @@ suite("test_action") {
test {
sql "abcdefg"
// check exception message contains
- exception "errCode = 2, detailMessage = Syntax error"
+ exception "ParseException"
}
test {
diff --git
a/regression-test/suites/nereids_p0/insert_into_table/update_on_current_timestamp.groovy
b/regression-test/suites/nereids_p0/insert_into_table/update_on_current_timestamp.groovy
index 35a68338835..db9529887dc 100644
---
a/regression-test/suites/nereids_p0/insert_into_table/update_on_current_timestamp.groovy
+++
b/regression-test/suites/nereids_p0/insert_into_table/update_on_current_timestamp.groovy
@@ -190,6 +190,6 @@ suite("nereids_update_on_current_timestamp") {
k int,
`update_time` datetime(6) default current_timestamp(4) on
update current_timestamp(3)) replace,
) AGGREGATE KEY(k) DISTRIBUTED BY HASH(k) BUCKETS 1
properties("replication_num" = "1");"""
- exception "Syntax error"
+ exception "ParseException"
}
}
diff --git a/regression-test/suites/query_p0/join/test_join2.groovy
b/regression-test/suites/query_p0/join/test_join2.groovy
index b64d40995a4..940a22bb912 100644
--- a/regression-test/suites/query_p0/join/test_join2.groovy
+++ b/regression-test/suites/query_p0/join/test_join2.groovy
@@ -84,7 +84,7 @@ suite("test_join2", "query,p0,arrow_flight_sql") {
FROM ${TBname1} NATURAL JOIN ${TBname2}
ORDER BY 1,2,3,4,5,6;
"""
- exception "errCode = 2, detailMessage = natural join is not supported,
please use inner join instead."
+ exception "ParseException"
}
qt_join4 """
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]