From 971e28481f767d6e264db4c624dfb2fa4b3bbf44 Mon Sep 17 00:00:00 2001 From: morningman Date: Fri, 29 Mar 2024 16:23:05 +0800 Subject: [PATCH] 1 --- .../java/org/apache/doris/qe/ConnectProcessor.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 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 d4640f970ee20b..8befffad8213a0 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 @@ -49,6 +49,7 @@ import org.apache.doris.mysql.MysqlSerializer; import org.apache.doris.mysql.MysqlServerStatusFlag; import org.apache.doris.nereids.exceptions.NotSupportedException; +import org.apache.doris.nereids.exceptions.ParseException; import org.apache.doris.nereids.glue.LogicalPlanAdapter; import org.apache.doris.nereids.minidump.MinidumpUtils; import org.apache.doris.nereids.parser.Dialect; @@ -232,11 +233,19 @@ public void executeQuery(MysqlCommand mysqlCommand, String originStmt) throws Ex // Parse sql failed, audit it and return handleQueryException(e, convertedStmt, null, null); return; - } catch (ParseEx) + } catch (ParseException e) { + if (LOG.isDebugEnabled()) { + LOG.debug("Nereids parse sql failed. Reason: {}. Statement: \"{}\".", + e.getMessage(), convertedStmt); + } + // ATTN: Do not set nereidsParseException in this case. + // Because ParseException means the sql is not supported by Nereids. + // It should be parsed by old parser, so not setting nereidsParseException to avoid + // suppressing the exception thrown by old parser. } catch (Exception e) { // TODO: We should catch all exception here until we support all query syntax. if (LOG.isDebugEnabled()) { - LOG.debug("Nereids parse sql failed. Reason: {}. Statement: \"{}\".", + LOG.debug("Nereids parse sql failed with other exception. Reason: {}. Statement: \"{}\".", e.getMessage(), convertedStmt); } nereidsParseException = e;