This is an automated email from the ASF dual-hosted git repository. snuyanzin pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/flink-connector-hive.git
commit bb52a8747fef2a3fba26246af448ba7477ad1a1f Author: Sergey Nuyanzin <[email protected]> AuthorDate: Fri Aug 16 09:40:28 2024 +0200 [FLINK-36085][table] Refactor SHOW operations with LIKE/ILIKE This closes #25200 Signed-off-by: snuyanzin <[email protected]> --- .../hive/parse/HiveParserDDLSemanticAnalyzer.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/flink-connector-hive/src/main/java/org/apache/flink/table/planner/delegation/hive/parse/HiveParserDDLSemanticAnalyzer.java b/flink-connector-hive/src/main/java/org/apache/flink/table/planner/delegation/hive/parse/HiveParserDDLSemanticAnalyzer.java index 8b72fece..bd8ef491 100644 --- a/flink-connector-hive/src/main/java/org/apache/flink/table/planner/delegation/hive/parse/HiveParserDDLSemanticAnalyzer.java +++ b/flink-connector-hive/src/main/java/org/apache/flink/table/planner/delegation/hive/parse/HiveParserDDLSemanticAnalyzer.java @@ -321,7 +321,7 @@ public class HiveParserDDLSemanticAnalyzer { res = convertDescribeTable(ast); break; case HiveASTParser.TOK_SHOWDATABASES: - res = convertShowDatabases(); + res = convertShowDatabases(catalogRegistry.getCurrentCatalog()); break; case HiveASTParser.TOK_SHOWTABLES: res = convertShowTables(ast, false); @@ -1803,8 +1803,8 @@ public class HiveParserDDLSemanticAnalyzer { HiveConf.getVar(conf, HiveConf.ConfVars.DEFAULTPARTITIONNAME)); } - private Operation convertShowDatabases() { - return new ShowDatabasesOperation(); + private Operation convertShowDatabases(String catalogName) { + return new ShowDatabasesOperation(catalogName); } private Operation convertShowTables(HiveParserASTNode ast, boolean expectView) { @@ -1843,7 +1843,11 @@ public class HiveParserDDLSemanticAnalyzer { if (pattern != null) { handleUnsupportedOperation("SHOW TABLES/VIEWS LIKE is not supported"); } - return expectView ? new ShowViewsOperation() : new ShowTablesOperation(); + return expectView + ? new ShowViewsOperation( + catalogRegistry.getCurrentCatalog(), catalogRegistry.getCurrentDatabase()) + : new ShowTablesOperation( + catalogRegistry.getCurrentCatalog(), catalogRegistry.getCurrentDatabase()); } /** @@ -1857,7 +1861,8 @@ public class HiveParserDDLSemanticAnalyzer { assert (ast.getChild(0).getType() == HiveASTParser.KW_LIKE); throw new ValidationException("SHOW FUNCTIONS LIKE is not supported yet"); } - return new ShowFunctionsOperation(); + return new ShowFunctionsOperation( + catalogRegistry.getCurrentCatalog(), catalogRegistry.getCurrentDatabase()); } private Operation convertAlterTableRename(
