nastra commented on code in PR #15572:
URL: https://github.com/apache/iceberg/pull/15572#discussion_r2945859328
##########
core/src/test/java/org/apache/iceberg/rest/TestRESTScanPlanning.java:
##########
@@ -1064,4 +1121,71 @@ private <T extends RESTResponse> T
maybeAddStorageCredential(T response) {
return response;
}
+
+ @Test
+ public void serverConfigTakesPrecedenceOnMismatch() {
+ // Client=SERVER, Server=CLIENT
+ CatalogWithAdapter catalogWithAdapter1 =
+ catalogWithModes(
+ RESTCatalogProperties.ScanPlanningMode.SERVER.modeName(),
+ RESTCatalogProperties.ScanPlanningMode.CLIENT.modeName());
+ catalogWithAdapter1.catalog.createNamespace(NS);
+
+ Table table1 =
+ catalogWithAdapter1
+ .catalog
+ .buildTable(TableIdentifier.of(NS, "mismatch_test"), SCHEMA)
+ .create();
+
+ assertThat(table1).isNotInstanceOf(RESTTable.class);
+ assertThat(table1).isInstanceOf(BaseTable.class);
+
+ // Client=CLIENT, Server=SERVER
+ CatalogWithAdapter catalogWithAdapter2 =
+ catalogWithModes(
+ RESTCatalogProperties.ScanPlanningMode.CLIENT.modeName(),
+ RESTCatalogProperties.ScanPlanningMode.SERVER.modeName());
+
+ Table table2 =
+ catalogWithAdapter2
+ .catalog
+ .buildTable(TableIdentifier.of(NS,
"client_override_rejected_test"), SCHEMA)
+ .create();
+
+ assertThat(table2).isInstanceOf(RESTTable.class);
+ }
+
+ @Test
+ public void clientExplicitlyRequestsClientSidePlanning() {
+ CatalogWithAdapter catalogWithAdapter =
+ catalogWithModes(
+ RESTCatalogProperties.ScanPlanningMode.CLIENT.modeName(),
+ RESTCatalogProperties.ScanPlanningMode.CLIENT.modeName());
+ catalogWithAdapter.catalog.createNamespace(NS);
+
+ Table table =
+ catalogWithAdapter
+ .catalog
+ .buildTable(TableIdentifier.of(NS, "client_explicit_test"), SCHEMA)
+ .create();
+
+ assertThat(table).isNotInstanceOf(RESTTable.class);
+ assertThat(table).isInstanceOf(BaseTable.class);
Review Comment:
same as above. assertions can be combined
--
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]