From c8b358c1a6fac79dd3935ed7de21dd92a8ce2c2f Mon Sep 17 00:00:00 2001 From: Chen Dai Date: Wed, 20 Mar 2024 08:46:54 -0700 Subject: [PATCH] Rename skipping index check method Signed-off-by: Chen Dai --- .../flint/spark/skipping/ApplyFlintSparkSkippingIndex.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flint-spark-integration/src/main/scala/org/opensearch/flint/spark/skipping/ApplyFlintSparkSkippingIndex.scala b/flint-spark-integration/src/main/scala/org/opensearch/flint/spark/skipping/ApplyFlintSparkSkippingIndex.scala index bb6a29262..51d6cc802 100644 --- a/flint-spark-integration/src/main/scala/org/opensearch/flint/spark/skipping/ApplyFlintSparkSkippingIndex.scala +++ b/flint-spark-integration/src/main/scala/org/opensearch/flint/spark/skipping/ApplyFlintSparkSkippingIndex.scala @@ -40,7 +40,7 @@ class ApplyFlintSparkSkippingIndex(flint: FlintSpark) extends Rule[LogicalPlan] false)) if hasNoDisjunction(condition) && !location.isInstanceOf[FlintSparkSkippingFileIndex] => val index = flint.describeIndex(getIndexName(table)) - if (hasActiveSkippingIndex(index)) { + if (isActiveSkippingIndex(index)) { val skippingIndex = index.get.asInstanceOf[FlintSparkSkippingIndex] val indexFilter = rewriteToIndexFilter(skippingIndex, condition) @@ -69,7 +69,7 @@ class ApplyFlintSparkSkippingIndex(flint: FlintSpark) extends Rule[LogicalPlan] // Check if query plan already rewritten table.isInstanceOf[LogsTable] && !table.asInstanceOf[LogsTable].hasFileIndexScan() => val index = flint.describeIndex(getIndexName(catalog, identifier)) - if (hasActiveSkippingIndex(index)) { + if (isActiveSkippingIndex(index)) { val skippingIndex = index.get.asInstanceOf[FlintSparkSkippingIndex] val indexFilter = rewriteToIndexFilter(skippingIndex, condition) /* @@ -123,7 +123,7 @@ class ApplyFlintSparkSkippingIndex(flint: FlintSpark) extends Rule[LogicalPlan] }.isEmpty } - private def hasActiveSkippingIndex(index: Option[FlintSparkIndex]): Boolean = { + private def isActiveSkippingIndex(index: Option[FlintSparkIndex]): Boolean = { index.isDefined && index.get.kind == SKIPPING_INDEX_TYPE && index.get.latestLogEntry.exists(_.state != DELETED)