morningman commented on code in PR #48527: URL: https://github.com/apache/doris/pull/48527#discussion_r1979567677
########## fe/fe-core/src/main/java/org/apache/doris/qe/AuditLogHelper.java: ########## @@ -269,9 +269,9 @@ private static void logAuditLogImpl(ConnectContext ctx, String origStmt, Stateme auditEventBuilder.setFeIp(FrontendOptions.getLocalHostAddress()); - boolean isAnalysisErr = ctx.getState().getStateType() == MysqlStateType.ERR - && ctx.getState().getErrType() == QueryState.ErrType.ANALYSIS_ERR; - String encryptSql = isAnalysisErr ? ctx.getState().getErrorMessage() : origStmt; + boolean isSyntaxErr = ctx.getState().getStateType() == MysqlStateType.ERR + && ctx.getState().getErrType() == QueryState.ErrType.SYNTAX_PARSE_ERR; + String encryptSql = isSyntaxErr ? ctx.getState().getErrorMessage() : origStmt; Review Comment: I think we should not use error msg here? use a place holder ########## fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java: ########## @@ -441,35 +442,36 @@ protected void handleQueryException(Throwable throwable, String origStmt, if (ctx.getMinidump() != null) { MinidumpUtils.saveMinidumpString(ctx.getMinidump(), DebugUtil.printId(ctx.queryId())); } - if (throwable instanceof ConnectionException) { + if (throwable instanceof SyntaxParseException) { + // Syntax parse exception. + Throwable e = new AnalysisException(throwable.getMessage(), throwable); + ctx.getState().setError(ErrorCode.ERR_UNKNOWN_ERROR, e.getMessage()); + ctx.getState().setErrType(QueryState.ErrType.SYNTAX_PARSE_ERR); + } else if (throwable instanceof ConnectionException) { // Throw this exception to close the connection outside. - LOG.warn("Process one query failed because ConnectionException: ", throwable); throw (ConnectionException) throwable; } else if (throwable instanceof IOException) { // Client failed. - LOG.warn("Process one query failed because IOException: ", throwable); ctx.getState().setError(ErrorCode.ERR_UNKNOWN_ERROR, "Doris process failed: " + throwable.getMessage()); } else if (throwable instanceof UserException) { - LOG.warn("Process one query failed because.", throwable); ctx.getState().setError(((UserException) throwable).getMysqlErrorCode(), throwable.getMessage()); // set it as ANALYSIS_ERR so that it won't be treated as a query failure. ctx.getState().setErrType(QueryState.ErrType.ANALYSIS_ERR); } else if (throwable instanceof NotSupportedException) { - LOG.warn("Process one query failed because.", throwable); ctx.getState().setError(ErrorCode.ERR_NOT_SUPPORTED_YET, throwable.getMessage()); // set it as ANALYSIS_ERR so that it won't be treated as a query failure. ctx.getState().setErrType(QueryState.ErrType.ANALYSIS_ERR); } else { // Catch all throwable. // If reach here, maybe palo bug. - LOG.warn("Process one query failed because unknown reason: ", throwable); ctx.getState().setError(ErrorCode.ERR_UNKNOWN_ERROR, throwable.getClass().getSimpleName() + ", msg: " + throwable.getMessage()); if (parsedStmt instanceof KillStmt) { // ignore kill stmt execute err(not monitor it) ctx.getState().setErrType(QueryState.ErrType.ANALYSIS_ERR); } } + LOG.warn("Process one query failed because.", throwable); Review Comment: Remove it or make it debug, or it will print too much log -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org