Skip to content

Commit

Permalink
Rename skipping index check method
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Dai <[email protected]>
  • Loading branch information
dai-chen committed Mar 20, 2024
1 parent d878587 commit c8b358c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
/*
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c8b358c

Please sign in to comment.