gaborkaszab commented on code in PR #14769:
URL: https://github.com/apache/iceberg/pull/14769#discussion_r2626231095
##########
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 think if we take a step back and take a look at user motivations, then we
see that the intent of passing a cache case sensitivity param to a catalog is
to have table name case sensitivity (or not to have). This is best tested if we
invoke some operation on the produced cache and check if there is in fact case
sensitivity.
The fact that there is a `CachingCatalog` underneath and that it has a
member called `caseSensitive` is an implementation detail and I wouldn't use
them for testing. I'd rather test the use-case from the user's perspective.
--
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]