From 3bb1d0d864f5db505293160dcf5b20347cb2a635 Mon Sep 17 00:00:00 2001 From: Sean Kao Date: Fri, 1 Mar 2024 08:59:48 -0800 Subject: [PATCH 1/2] sql grammar support for show flint index statement Signed-off-by: Sean Kao --- .../src/main/antlr4/FlintSparkSqlExtensions.g4 | 9 +++++++++ flint-spark-integration/src/main/antlr4/SparkSqlBase.g4 | 1 + 2 files changed, 10 insertions(+) diff --git a/flint-spark-integration/src/main/antlr4/FlintSparkSqlExtensions.g4 b/flint-spark-integration/src/main/antlr4/FlintSparkSqlExtensions.g4 index 4de5bfaa6..3a5c56f19 100644 --- a/flint-spark-integration/src/main/antlr4/FlintSparkSqlExtensions.g4 +++ b/flint-spark-integration/src/main/antlr4/FlintSparkSqlExtensions.g4 @@ -18,6 +18,7 @@ statement : skippingIndexStatement | coveringIndexStatement | materializedViewStatement + | indexManagementStatement | indexJobManagementStatement ; @@ -125,6 +126,14 @@ vacuumMaterializedViewStatement : VACUUM MATERIALIZED VIEW mvName=multipartIdentifier ; +indexManagementStatement + : showFlintIndexStatement + ; + +showFlintIndexStatement + : SHOW FLINT (INDEX | INDEXES) + ; + indexJobManagementStatement : recoverIndexJobStatement ; diff --git a/flint-spark-integration/src/main/antlr4/SparkSqlBase.g4 b/flint-spark-integration/src/main/antlr4/SparkSqlBase.g4 index 82c890a61..01f45016d 100644 --- a/flint-spark-integration/src/main/antlr4/SparkSqlBase.g4 +++ b/flint-spark-integration/src/main/antlr4/SparkSqlBase.g4 @@ -161,6 +161,7 @@ DESCRIBE: 'DESCRIBE'; DROP: 'DROP'; EXISTS: 'EXISTS'; FALSE: 'FALSE'; +FLINT: 'FLINT'; IF: 'IF'; IN: 'IN'; INDEX: 'INDEX'; From 0598a3251872d9ade3a1b0f1979b4707a8a72584 Mon Sep 17 00:00:00 2001 From: Sean Kao Date: Fri, 1 Mar 2024 11:33:56 -0800 Subject: [PATCH 2/2] Update statement to be more explicit and clear Signed-off-by: Sean Kao --- .../src/main/antlr4/FlintSparkSqlExtensions.g4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flint-spark-integration/src/main/antlr4/FlintSparkSqlExtensions.g4 b/flint-spark-integration/src/main/antlr4/FlintSparkSqlExtensions.g4 index 3a5c56f19..219bbe782 100644 --- a/flint-spark-integration/src/main/antlr4/FlintSparkSqlExtensions.g4 +++ b/flint-spark-integration/src/main/antlr4/FlintSparkSqlExtensions.g4 @@ -131,7 +131,7 @@ indexManagementStatement ; showFlintIndexStatement - : SHOW FLINT (INDEX | INDEXES) + : SHOW FLINT (INDEX | INDEXES) IN catalogDb=multipartIdentifier ; indexJobManagementStatement