From 44cee52e98e865340f287cd6570072dd76196355 Mon Sep 17 00:00:00 2001 From: peiwangdb Date: Wed, 15 Sep 2021 10:34:26 -0700 Subject: [PATCH] Hindex: fix btreeindex close issue --- .../main/java/io/prestosql/heuristicindex/IndexCache.java | 5 ++++- .../java/io/prestosql/spi/heuristicindex/IndexCacheKey.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/presto-main/src/main/java/io/prestosql/heuristicindex/IndexCache.java b/presto-main/src/main/java/io/prestosql/heuristicindex/IndexCache.java index b169b81cd..9b0c389c1 100644 --- a/presto-main/src/main/java/io/prestosql/heuristicindex/IndexCache.java +++ b/presto-main/src/main/java/io/prestosql/heuristicindex/IndexCache.java @@ -247,7 +247,10 @@ public class IndexCache cache.invalidate(filterKey); break; case TABLE: - // no need to break index, and lastModifiedTime is not used for TABLE level. no need to do anything + // no need to break index, and lastModifiedTime is not used for TABLE level, but we need to + // toggle back the noCloseFlag, as it was previously set to true. + filterKey.setNoCloseFlag(false); + break; } } catch (ExecutionException e) { diff --git a/presto-spi/src/main/java/io/prestosql/spi/heuristicindex/IndexCacheKey.java b/presto-spi/src/main/java/io/prestosql/spi/heuristicindex/IndexCacheKey.java index 973bffa69..780c2e433 100644 --- a/presto-spi/src/main/java/io/prestosql/spi/heuristicindex/IndexCacheKey.java +++ b/presto-spi/src/main/java/io/prestosql/spi/heuristicindex/IndexCacheKey.java @@ -87,7 +87,7 @@ public class IndexCacheKey public void setNoCloseFlag(boolean flag) { - this.noCloseFlag = true; + this.noCloseFlag = flag; } public boolean skipCloseIndex()