gaborkaszab commented on code in PR #14769:
URL: https://github.com/apache/iceberg/pull/14769#discussion_r2623285511


##########
flink/v2.1/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogFactory.java:
##########
@@ -106,6 +108,28 @@ public void testLoadCatalogUnknown() {
         .hasMessageStartingWith("Unknown catalog-type: fooType");
   }
 
+  @Test
+  public void testCacheCaseSensitivePropertyIsRespected() throws Exception {
+    String catalogName = "caseSensitiveCatalog";
+
+    props.put(
+        FlinkCatalogFactory.ICEBERG_CATALOG_TYPE, 
FlinkCatalogFactory.ICEBERG_CATALOG_TYPE_HADOOP);
+    props.put(CatalogProperties.CACHE_ENABLED, "true");

Review Comment:
   nit: this and the one below aren't needed for this test. The cache is turned 
on by default, and the expiration interval has no effect on the test.



##########
flink/v2.1/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogFactory.java:
##########
@@ -106,6 +108,28 @@ public void testLoadCatalogUnknown() {
         .hasMessageStartingWith("Unknown catalog-type: fooType");
   }
 
+  @Test
+  public void testCacheCaseSensitivePropertyIsRespected() throws Exception {
+    String catalogName = "caseSensitiveCatalog";
+
+    props.put(
+        FlinkCatalogFactory.ICEBERG_CATALOG_TYPE, 
FlinkCatalogFactory.ICEBERG_CATALOG_TYPE_HADOOP);
+    props.put(CatalogProperties.CACHE_ENABLED, "true");
+    props.put(CatalogProperties.CACHE_EXPIRATION_INTERVAL_MS, "-1");
+    props.put(CatalogProperties.CACHE_CASE_SENSITIVE, "false");
+    org.apache.flink.table.catalog.Catalog flinkCatalog =
+        new FlinkCatalogFactory().createCatalog(catalogName, props, new 
Configuration());
+
+    Catalog icebergCatalog = ((FlinkCatalog) flinkCatalog).catalog();
+
+    assertThat(icebergCatalog).isInstanceOf(CachingCatalog.class);
+
+    Field field = CachingCatalog.class.getDeclaredField("caseSensitive");

Review Comment:
   I'd do the verification otherwise: Create a table in the catalog with 
uppercase letters, and then load the table through the catalog with lowercase 
letters. If the property is respected, loading should succeed. Alternatively, 
instead of loading a table you can run table exists too.
   As an extra it can also be verified that the load request was served from 
the cache, by checking cache stats, and maybe that the returned table object is 
the same as in the cache.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to