singhpk234 commented on code in PR #14767:
URL: https://github.com/apache/iceberg/pull/14767#discussion_r2670641223
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -151,6 +175,21 @@ private CloseableIterable<FileScanTask>
planTableScan(PlanTableScanRequest planT
this.planId = response.planId();
PlanStatus planStatus = response.planStatus();
+ List<Credential> storageCredentials = response.credentials();
+ if (null != planId && !response.credentials().isEmpty()) {
Review Comment:
planId can't be null right ?
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -151,6 +175,21 @@ private CloseableIterable<FileScanTask>
planTableScan(PlanTableScanRequest planT
this.planId = response.planId();
PlanStatus planStatus = response.planStatus();
+ List<Credential> storageCredentials = response.credentials();
+ if (null != planId && !response.credentials().isEmpty()) {
+ this.fileIOForPlanId =
+ CatalogUtil.loadFileIO(
+ FILE_IO_IMPL,
+ ImmutableMap.<String, String>builder()
+ .putAll(catalogProperties)
+ .put(RESTCatalogProperties.REST_SCAN_PLAN_ID, planId)
+ .buildKeepingLast(),
+ hadoopConf,
+ storageCredentials.stream()
+ .map(c -> StorageCredential.create(c.prefix(), c.config()))
Review Comment:
how about async planning ?
let say plan api says submitted status so it wouldn't vend creds here and
neither are we gonna create a new file IO, i believe we should also add this in
the fetchPlanningResult API ? wdyt
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -151,6 +175,21 @@ private CloseableIterable<FileScanTask>
planTableScan(PlanTableScanRequest planT
this.planId = response.planId();
PlanStatus planStatus = response.planStatus();
+ List<Credential> storageCredentials = response.credentials();
Review Comment:
it might happen server doesn't wanna return creds here at all and in this
case we wanna reuse the creds vended in table, should the fileIO still send
plan-id in the /credentials call ?
##########
core/src/main/java/org/apache/iceberg/rest/RESTCatalogProperties.java:
##########
@@ -41,6 +41,8 @@ private RESTCatalogProperties() {}
public static final String REST_SCAN_PLANNING_ENABLED =
"rest-scan-planning-enabled";
public static final boolean REST_SCAN_PLANNING_ENABLED_DEFAULT = false;
+ public static final String REST_SCAN_PLAN_ID = "rest-scan-plan-id";
Review Comment:
should we fail if we server sends this key ? i understand we overrwrite this
prop with the plan-id but should we silently overrwrite or fail ?
--
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]