xinyiZzz commented on code in PR #33264: URL: https://github.com/apache/doris/pull/33264#discussion_r1581790675
########## fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java: ########## @@ -3486,7 +3488,19 @@ public LogicalPlan visitDropProcedure(DropProcedureContext ctx) { @Override public LogicalPlan visitShowProcedureStatus(ShowProcedureStatusContext ctx) { - return ParserUtils.withOrigin(ctx, () -> new ShowProcedureStatusCommand()); + Set<Expression> whereExpr = Collections.emptySet(); + if (ctx.whereClause() != null) { + whereExpr = ExpressionUtils.extractConjunctionToSet( + getExpression(ctx.whereClause().booleanExpression())); + } + + if (ctx.valueExpression() != null) { + // parser allows only LIKE or WhereClause. Review Comment: additional comment: Mysql grammar: SHOW PROCEDURE STATUS [LIKE 'pattern' | WHERE expr] https://dev.mysql.com/doc/refman/8.0/en/show-procedure-status.html ########## fe/fe-core/src/main/java/org/apache/doris/plsql/functions/DorisFunctionRegistry.java: ########## @@ -89,15 +92,57 @@ private String qualified(String name) { return (ConnectContext.get().getDatabase() + "." + name).toUpperCase(); } + private String getDbName(long catalogId, long dbId) { + String dbName = ""; + CatalogIf catalog = Env.getCurrentEnv().getCatalogMgr().getCatalog(catalogId); + if (catalog != null) { + DatabaseIf db = catalog.getDbNullable(dbId); + if (db != null) { + dbName = db.getFullName(); + } + } + return dbName; + } + + public static boolean like(String str, String expr) { Review Comment: refer to `ShowFunctionsStmt`, `ShowEncryptKeysStmt`, `ShowTableCreationStmt` can rewrite as: ``` public boolean like(String str) { str = str.toLowerCase(); return str.matches(wild.replace(".", "\\.").replace("?", ".").replace("%", ".*").toLowerCase()); } ``` -- 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