starocean999 commented on code in PR #41913: URL: https://github.com/apache/doris/pull/41913#discussion_r1804319316
########## fe/fe-core/src/main/java/org/apache/doris/qe/AuditLogHelper.java: ########## @@ -259,10 +260,20 @@ private static void logAuditLogImpl(ConnectContext ctx, String origStmt, Stateme auditEventBuilder.setFeIp(FrontendOptions.getLocalHostAddress()); // We put origin query stmt at the end of audit log, for parsing the log more convenient. - if (!ctx.getState().isQuery() && (parsedStmt != null && parsedStmt.needAuditEncryption())) { - auditEventBuilder.setStmt(parsedStmt.toSql()); + if (parsedStmt instanceof LogicalPlanAdapter) { + if (!ctx.getState().isQuery() && (parsedStmt != null + && (((LogicalPlanAdapter) parsedStmt).getLogicalPlan() instanceof Command)) + && ((Command) ((LogicalPlanAdapter) parsedStmt).getLogicalPlan()).needAuditEncryption()) { Review Comment: use trait here toSql and needAuditEncryption() must be implemented together -- 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