diff --git a/flint-spark-integration/src/main/antlr4/FlintSparkSqlExtensions.g4 b/flint-spark-integration/src/main/antlr4/FlintSparkSqlExtensions.g4 index a5f0f993b..ab81100f4 100644 --- a/flint-spark-integration/src/main/antlr4/FlintSparkSqlExtensions.g4 +++ b/flint-spark-integration/src/main/antlr4/FlintSparkSqlExtensions.g4 @@ -96,6 +96,7 @@ materializedViewStatement | showMaterializedViewStatement | describeMaterializedViewStatement | dropMaterializedViewStatement + | vacuumMaterializedViewStatement ; createMaterializedViewStatement diff --git a/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkCoveringIndexSqlITSuite.scala b/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkCoveringIndexSqlITSuite.scala index 3ad5f0d0f..450da14c9 100644 --- a/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkCoveringIndexSqlITSuite.scala +++ b/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkCoveringIndexSqlITSuite.scala @@ -267,7 +267,7 @@ class FlintSparkCoveringIndexSqlITSuite extends FlintSparkSuite { checkAnswer(result, Seq(Row("name", "string", "indexed"), Row("age", "int", "indexed"))) } - test("drop covering index") { + test("drop and vacuum covering index") { flint .coveringIndex() .name(testIndex) @@ -276,7 +276,7 @@ class FlintSparkCoveringIndexSqlITSuite extends FlintSparkSuite { .create() sql(s"DROP INDEX $testIndex ON $testTable") - + sql(s"VACUUM INDEX $testIndex ON $testTable") flint.describeIndex(testFlintIndex) shouldBe empty } } diff --git a/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkIndexNameITSuite.scala b/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkIndexNameITSuite.scala index 5b47edc46..32b9ab458 100644 --- a/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkIndexNameITSuite.scala +++ b/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkIndexNameITSuite.scala @@ -56,6 +56,7 @@ class FlintSparkIndexNameITSuite extends FlintSparkSuite { indexData should have size 1 sql(s"DROP SKIPPING INDEX ON $testTable") + sql(s"VACUUM SKIPPING INDEX ON $testTable") flint.describeIndex(flintIndexName) shouldBe empty } @@ -76,6 +77,7 @@ class FlintSparkIndexNameITSuite extends FlintSparkSuite { indexData should have size 1 sql(s"DROP INDEX $testIndex ON $testTable") + sql(s"VACUUM INDEX $testIndex ON $testTable") flint.describeIndex(flintIndexName) shouldBe empty } } diff --git a/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkMaterializedViewSqlITSuite.scala b/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkMaterializedViewSqlITSuite.scala index bff5d44eb..ed702c7a1 100644 --- a/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkMaterializedViewSqlITSuite.scala +++ b/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkMaterializedViewSqlITSuite.scala @@ -255,7 +255,7 @@ class FlintSparkMaterializedViewSqlITSuite extends FlintSparkSuite { checkAnswer(sql("DESC MATERIALIZED VIEW nonexistent_mv"), Seq()) } - test("drop materialized view") { + test("drop and vacuum materialized view") { flint .materializedView() .name(testMvName) @@ -263,7 +263,7 @@ class FlintSparkMaterializedViewSqlITSuite extends FlintSparkSuite { .create() sql(s"DROP MATERIALIZED VIEW $testMvName") - + sql(s"VACUUM MATERIALIZED VIEW $testMvName") flint.describeIndex(testFlintIndex) shouldBe empty } diff --git a/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkSkippingIndexSqlITSuite.scala b/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkSkippingIndexSqlITSuite.scala index a862fd162..f1a6286e6 100644 --- a/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkSkippingIndexSqlITSuite.scala +++ b/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkSkippingIndexSqlITSuite.scala @@ -249,7 +249,7 @@ class FlintSparkSkippingIndexSqlITSuite extends FlintSparkSuite { checkAnswer(result, Seq.empty) } - test("drop skipping index") { + test("drop and vacuum skipping index") { flint .skippingIndex() .onTable(testTable) @@ -257,7 +257,7 @@ class FlintSparkSkippingIndexSqlITSuite extends FlintSparkSuite { .create() sql(s"DROP SKIPPING INDEX ON $testTable") - + sql(s"VACUUM SKIPPING INDEX ON $testTable") flint.describeIndex(testIndex) shouldBe empty } }