nastra commented on code in PR #13400:
URL: https://github.com/apache/iceberg/pull/13400#discussion_r2538826639


##########
core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java:
##########
@@ -268,6 +345,51 @@ protected RESTCatalog catalog() {
     return restCatalog;
   }
 
+  /**
+   * Configure planning behavior for the current test. Call this at the start 
of each test that
+   * needs specific planning behavior.
+   *
+   * @param configurator Function to configure the behavior builder
+   */
+  protected void configurePlanningBehavior(
+      Function<TestPlanningBehavior.Builder, TestPlanningBehavior.Builder> 
configurator) {
+    TestPlanningBehavior.Builder builder = TestPlanningBehavior.builder();
+    this.currentPlanningBehavior = configurator.apply(builder).build();
+  }
+
+  /**
+   * Creates a table with REST scan planning enabled. Uses the currently 
configured planning
+   * behavior.
+   *
+   * @param tableName Simple table name (will be created in default namespace)
+   * @return Created table with scan planning enabled
+   */
+  protected Table createTableWithScanPlanning(String tableName) {
+    return createTableWithScanPlanning(TableIdentifier.of(NS, tableName));
+  }
+
+  /**
+   * Creates a table with REST scan planning enabled. Uses the currently 
configured planning
+   * behavior.
+   *
+   * @param identifier Table identifier with namespace
+   * @return Created table with scan planning enabled
+   */
+  protected Table createTableWithScanPlanning(TableIdentifier identifier) {
+    RESTCatalog catalog =
+        initCatalog(
+            "prod", 
ImmutableMap.of(RESTCatalogProperties.REST_SERVER_PLANNING_ENABLED, "true"));
+
+    if (requiresNamespaceCreate()) {
+      catalog.createNamespace(identifier.namespace());
+    }
+
+    Table table = catalog.buildTable(identifier, 
SCHEMA).withPartitionSpec(SPEC).create();
+
+    table.newAppend().appendFile(FILE_A).commit();

Review Comment:
   maybe the append should be outside of this method, since the naming suggests 
that it only creates the table but doesn't do anything else?



-- 
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