nastra commented on code in PR #15572:
URL: https://github.com/apache/iceberg/pull/15572#discussion_r2945852478
##########
core/src/test/java/org/apache/iceberg/rest/TestRESTScanPlanning.java:
##########
@@ -859,27 +919,24 @@ public <T extends RESTResponse> T execute(
ImmutableMap.of(
CatalogProperties.FILE_IO_IMPL,
"org.apache.iceberg.inmemory.InMemoryFileIO",
- RESTCatalogProperties.REST_SCAN_PLANNING_ENABLED,
- "true"));
+ RESTCatalogProperties.SCAN_PLANNING_MODE,
+ RESTCatalogProperties.ScanPlanningMode.SERVER.modeName()));
return new CatalogWithAdapter(catalog, adapter);
}
@Test
public void serverDoesNotSupportPlanningEndpoint() throws IOException {
- // Server doesn't support scan planning at all - should fall back to
client-side planning
+ // Server requires server-side planning but doesn't support the endpoint -
should fail
CatalogWithAdapter catalogWithAdapter =
catalogWithEndpoints(baseCatalogEndpoints(), null);
RESTCatalog catalog = catalogWithAdapter.catalog;
- Table table = createTableWithScanPlanning(catalog, "no_planning_support");
- assertThat(table).isNotInstanceOf(RESTTable.class);
- table.newAppend().appendFile(FILE_A).commit();
- // Should fall back to client-side planning when endpoint is not supported
- assertThat(table.newScan().planFiles())
- .hasSize(1)
- .first()
- .extracting(ContentScanTask::file)
- .extracting(ContentFile::location)
- .isEqualTo(FILE_A.location());
+ catalog.createNamespace(NS);
+ assertThatThrownBy(
+ () ->
+ catalog.buildTable(TableIdentifier.of(NS,
"no_planning_support"), SCHEMA).create())
+ .isInstanceOf(IllegalStateException.class)
+ .hasMessageContaining("Server requires server-side scan planning")
Review Comment:
nit: I would prefer to match the error msg exactly as this makes sure that
the error msg is properly readable for clients
--
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]