From cf6288e3ea9afb6810a2f2c0e9b68881e3e4ecaa Mon Sep 17 00:00:00 2001 From: peiwangdb Date: Wed, 29 Sep 2021 09:41:35 -0700 Subject: [PATCH] hindex: fix cachekey inserting bug for partitioned table --- .../src/main/java/io/prestosql/heuristicindex/IndexCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 43088353c..34886a6fb 100644 --- a/presto-main/src/main/java/io/prestosql/heuristicindex/IndexCache.java +++ b/presto-main/src/main/java/io/prestosql/heuristicindex/IndexCache.java @@ -231,7 +231,7 @@ public class IndexCache Path indexUri = Paths.get(index.getUri()); String partition = null; // get partition name from path if present - for (int i = indexUri.getNameCount() - 1; i >= 0; i--) { + for (int i = 0; i < indexUri.getNameCount(); i++) { if (indexUri.getName(i).toString().contains("=")) { partition = indexUri.getName(i).toString(); break;