From d878587db3f8f45b33b393b84d0362d3f0ecde51 Mon Sep 17 00:00:00 2001 From: Chen Dai Date: Tue, 19 Mar 2024 15:18:34 -0700 Subject: [PATCH] Add IT Signed-off-by: Chen Dai --- .../FlintSparkSkippingIndexITSuite.scala | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkSkippingIndexITSuite.scala b/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkSkippingIndexITSuite.scala index a4e7cfa79..b663b19bd 100644 --- a/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkSkippingIndexITSuite.scala +++ b/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkSkippingIndexITSuite.scala @@ -308,6 +308,28 @@ class FlintSparkSkippingIndexITSuite extends FlintSparkSuite { } } + test("should not rewrite original query if skipping index is logically deleted") { + flint + .skippingIndex() + .onTable(testTable) + .addPartitions("year", "month") + .create() + flint.deleteIndex(testIndex) + + val query = + s""" + | SELECT name + | FROM $testTable + | WHERE year = 2023 AND month = 4 + |""".stripMargin + + val actual = sql(query).queryExecution.optimizedPlan + withFlintOptimizerDisabled { + val expect = sql(query).queryExecution.optimizedPlan + actual shouldBe expect + } + } + test("can build partition skipping index and rewrite applicable query") { flint .skippingIndex()