From 18722686716e919456e14292dfeb98340ca4148b Mon Sep 17 00:00:00 2001 From: Corvin Kuebler Date: Thu, 25 Jul 2024 08:45:31 +0200 Subject: [PATCH] [MXP-2662](https://jira.tools.sap/browse/MXP-2662). Remove caching lookup in jdbc schema to prevent further issues with inconsistencies Signed-off-by: Corvin Kuebler --- .../java/org/apache/calcite/adapter/jdbc/JdbcSchema.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java index 6c8dc9ec1c7..dee0bd41235 100644 --- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java +++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java @@ -27,7 +27,6 @@ import org.apache.calcite.rel.type.RelDataTypeSystem; import org.apache.calcite.rel.type.RelProtoDataType; import org.apache.calcite.schema.*; -import org.apache.calcite.schema.lookup.CachingLookup; import org.apache.calcite.schema.lookup.IgnoreCaseLookup; import org.apache.calcite.schema.lookup.LikePattern; import org.apache.calcite.schema.lookup.Lookup; @@ -88,7 +87,7 @@ public class TableNotFoundException extends RuntimeException { final @Nullable String schema; public final SqlDialect dialect; final JdbcConvention convention; - private final Lookup tables = new CachingLookup
(new IgnoreCaseLookup
() { + private final Lookup
tables = new IgnoreCaseLookup
() { @Override public @Nullable Table get(String name) { try (Stream s = getMetaTableStream(name)) { @@ -102,7 +101,7 @@ public Set getNames(LikePattern pattern) { return s.map(it -> it.tableName).collect(Collectors.toSet()); } } - }); + }; private final Lookup subSchemas = Lookup.empty(); @Experimental