You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "nastra (via GitHub)" <gi...@apache.org> on 2026/03/09 11:49:41 UTC
[PR] API, Core: Add FileIO to Scan API [iceberg]
nastra opened a new pull request, #15561:
URL: https://github.com/apache/iceberg/pull/15561
This adds `FileIO` to the `Scan` API and is extracted from https://github.com/apache/iceberg/pull/15448
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913290509
##########
core/src/main/java/org/apache/iceberg/SerializableFileIO.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.iceberg.hadoop.HadoopConfigurable;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.util.SerializableSupplier;
+
+public class SerializableFileIO {
+ private SerializableFileIO() {}
+
+ public static FileIO copyOf(FileIO fileIO) {
Review Comment:
This doesn't copy the `FileIO`. It just wraps the conf of the existing one.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913511707
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -190,8 +192,9 @@ private CloseableIterable<FileScanTask> planTableScan(PlanTableScanRequest planT
this.planId = response.planId();
PlanStatus planStatus = response.planStatus();
- if (null != planId && !response.credentials().isEmpty()) {
- this.fileIOForPlanId = fileIOForPlanId(response.credentials());
+ if (null != planId) {
+ this.fileIOForPlanId =
+ !response.credentials().isEmpty() ? fileIOForPlanId(response.credentials()) : tableIo;
Review Comment:
Why is this duplicated? And why does it require a `planId`?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2916325709
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -131,14 +131,16 @@ protected TableScan newRefinedScan(
tableIdentifier,
resourcePaths,
supportedEndpoints,
- io(),
+ null != fileIOForPlanId ? fileIOForPlanId : tableIo,
catalogProperties,
hadoopConf);
}
@Override
- protected FileIO io() {
- return null != fileIOForPlanId ? fileIOForPlanId : tableIo;
+ public FileIO io() {
+ Preconditions.checkState(
+ null != fileIOForPlanId, "Invalid FileIO: planFiles() must be called first");
Review Comment:
I think we want to be explicit here and indicate that the FileIO isn't ready to be used when you call it before actually calling `planFiles()`. Using the FileIO before the server had a chance to provide the right credentials will almost always cause permission issues
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2921132154
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -131,14 +131,16 @@ protected TableScan newRefinedScan(
tableIdentifier,
resourcePaths,
supportedEndpoints,
- io(),
+ null != scanFileIO ? scanFileIO : tableIO,
catalogProperties,
hadoopConf);
}
@Override
- protected FileIO io() {
- return null != fileIOForPlanId ? fileIOForPlanId : tableIO;
+ public FileIO io() {
+ Preconditions.checkState(
+ null != scanFileIO, "Cannot use FileIO because planFiles() must be called first");
Review Comment:
How about `"Cannot access FileIO: planFiles() must be called first"`? Or maybe `"FileIO is not available: planFiles() must be called first"`? I think I prefer the second. And both fit with the style of error messages for the project, which is to be direct ("FileIO is not available") and then describe why ("planFiles() must be called first") with a clear distinction.
I think it is good to avoid full sentences because that makes error messages longer and more complicated. Making error messages sentences introduces problems like needing a subject or to conjugate something in an awkward way. In this case, it's just shorter to omit "because" and use the standard format of `"What: why"`.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2916261766
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -190,8 +192,9 @@ private CloseableIterable<FileScanTask> planTableScan(PlanTableScanRequest planT
this.planId = response.planId();
PlanStatus planStatus = response.planStatus();
- if (null != planId && !response.credentials().isEmpty()) {
- this.fileIOForPlanId = fileIOForPlanId(response.credentials());
+ if (null != planId) {
+ this.fileIOForPlanId =
+ !response.credentials().isEmpty() ? fileIOForPlanId(response.credentials()) : tableIo;
Review Comment:
the PlanID is added as additional context to the FileIO so that the server has additional context when the credentials need to be refreshed
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913389454
##########
core/src/main/java/org/apache/iceberg/SerializableTable.java:
##########
@@ -83,7 +80,7 @@ protected SerializableTable(Table table) {
Map<Integer, PartitionSpec> specs = table.specs();
specs.forEach((specId, spec) -> specAsJsonMap.put(specId, PartitionSpecParser.toJson(spec)));
this.sortOrderAsJson = SortOrderParser.toJson(table.sortOrder());
- this.io = fileIO(table);
+ this.io = SerializableFileIO.copyOf(table.io());
Review Comment:
Oh, nevermind. This should be the table's `FileIO`, which could be different.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2927565115
##########
core/src/test/java/org/apache/iceberg/rest/TestRESTScanPlanning.java:
##########
@@ -953,4 +957,111 @@ public void serverSupportsPlanningButNotCancellation() throws IOException {
// Verify no exception was thrown - cancelPlan returns false when endpoint not supported
assertThat(cancelled).isFalse();
}
+
+ @ParameterizedTest
+ @EnumSource(PlanningMode.class)
+ void fileIOForRemotePlanningIsPropagated(
+ Function<TestPlanningBehavior.Builder, TestPlanningBehavior.Builder> planMode) {
+ RESTCatalogAdapter adapter =
+ Mockito.spy(
+ new RESTCatalogAdapter(backendCatalog) {
+ @Override
+ public <T extends RESTResponse> T execute(
+ HTTPRequest request,
+ Class<T> responseType,
+ Consumer<ErrorResponse> errorHandler,
+ Consumer<Map<String, String>> responseHeaders,
+ ParserContext parserContext) {
+ T response =
+ super.execute(
+ request, responseType, errorHandler, responseHeaders, parserContext);
+ return maybeAddStorageCredential(response);
+ }
+ });
+
+ adapter.setPlanningBehavior(planMode.apply(TestPlanningBehavior.builder()).build());
+
+ RESTCatalog catalog =
+ new RESTCatalog(SessionCatalog.SessionContext.createEmpty(), (config) -> adapter);
+ catalog.initialize(
+ "test",
+ ImmutableMap.of(
+ CatalogProperties.FILE_IO_IMPL,
+ "org.apache.iceberg.inmemory.InMemoryFileIO",
+ RESTCatalogProperties.REST_SCAN_PLANNING_ENABLED,
+ "true"));
+
+ Table table = restTableFor(catalog, "file_io_propagation");
+
+ assertThat(table.io().properties()).doesNotContainKey(RESTCatalogProperties.REST_SCAN_PLAN_ID);
+
+ TableScan tableScan = table.newScan();
+ assertThatThrownBy(tableScan::io)
+ .isInstanceOf(IllegalStateException.class)
+ .hasMessage("FileIO is not available: planFiles() must be called first");
+
+ // make sure remote scan planning is called and FileIO gets the planId
+ assertThat(tableScan.planFiles()).hasSize(1);
+ assertThat(table.io().properties()).doesNotContainKey(RESTCatalogProperties.REST_SCAN_PLAN_ID);
Review Comment:
I noted that mixing the plan ID into properties is not a great solution above. And I want to point out that this assertion is necessary because of it. We have to make sure we're not modifying the wrong property map and worry about cases where user-driven config passes in a hard-coded plan ID (see `buildKeepingLast()`). I don't know that there's an easy fix, but this is not a pattern we want in the codebase.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#issuecomment-4052909340
thanks for the reviews @RussellSpitzer and @rdblue. I'll get this merged so that we can address the other items in separate PRs
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913485515
##########
api/src/main/java/org/apache/iceberg/Scan.java:
##########
@@ -208,4 +209,13 @@ default ThisT minRowsRequested(long numRows) {
throw new UnsupportedOperationException(
this.getClass().getName() + " doesn't implement minRowsRequested");
}
+
+ /**
+ * The {@link FileIO} instance to use when reading data files for this scan.
+ *
+ * @return the {@link FileIO} instance to use when reading data files for this scan
Review Comment:
Docs here are a bit redundant, you could just do a single line
```java
/** Returns the {@link FileIO} instance to use when reading data files **/
```
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913380505
##########
core/src/main/java/org/apache/iceberg/SerializableTable.java:
##########
@@ -83,7 +80,7 @@ protected SerializableTable(Table table) {
Map<Integer, PartitionSpec> specs = table.specs();
specs.forEach((specId, spec) -> specAsJsonMap.put(specId, PartitionSpecParser.toJson(spec)));
this.sortOrderAsJson = SortOrderParser.toJson(table.sortOrder());
- this.io = fileIO(table);
+ this.io = SerializableFileIO.copyOf(table.io());
Review Comment:
This is going to end up serializing `FileIO` twice. Can you add a version that delegates to a serializable `Supplier<FileIO>` so we can wrap the broadcast?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913516557
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -131,14 +131,16 @@ protected TableScan newRefinedScan(
tableIdentifier,
resourcePaths,
supportedEndpoints,
- io(),
+ null != fileIOForPlanId ? fileIOForPlanId : tableIo,
Review Comment:
I think `fileIOForPlanId` should be called `scanFileIO`. And it should be initialized once after the plan endpoint returns success. I don't see why the plan ID matters.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2909492172
##########
core/src/main/java/org/apache/iceberg/SerializableFileIO.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.iceberg.hadoop.HadoopConfigurable;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.util.SerializableSupplier;
+
+public class SerializableFileIO {
Review Comment:
we're planning to broadcast the `FileIO` instance in Spark in https://github.com/apache/iceberg/pull/15448, so pulling this code into its own class
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2921325512
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -212,14 +213,17 @@ private CloseableIterable<FileScanTask> planTableScan(PlanTableScanRequest planT
}
}
- private FileIO fileIOForPlanId(List<Credential> storageCredentials) {
+ private FileIO scanFileIO(List<Credential> storageCredentials) {
+ ImmutableMap.Builder<String, String> builder =
+ ImmutableMap.<String, String>builder().putAll(catalogProperties);
+ if (null != planId) {
+ builder.put(RESTCatalogProperties.REST_SCAN_PLAN_ID, planId);
+ }
+
FileIO ioForScan =
CatalogUtil.loadFileIO(
catalogProperties.getOrDefault(CatalogProperties.FILE_IO_IMPL, DEFAULT_FILE_IO_IMPL),
- ImmutableMap.<String, String>builder()
- .putAll(catalogProperties)
- .put(RESTCatalogProperties.REST_SCAN_PLAN_ID, planId)
- .buildKeepingLast(),
+ builder.buildKeepingLast(),
Review Comment:
As a style point, I don't see why the builder is finalized here rather than above after this is done adding to it. Separating this from building the properties just makes this expression longer and harder to understand.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2916897796
##########
core/src/main/java/org/apache/iceberg/FileIOUtil.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.iceberg.hadoop.HadoopConfigurable;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.util.SerializableSupplier;
+
+public class SerializableFileIO {
+ private SerializableFileIO() {}
+
+ public static FileIO copyOf(FileIO fileIO) {
+ if (fileIO instanceof HadoopConfigurable) {
+ ((HadoopConfigurable) fileIO).serializeConfWith(SerializableConfSupplier::new);
+ }
+
+ return fileIO;
+ }
+
+ // captures the current state of a Hadoop configuration in a serializable manner
+ private static class SerializableConfSupplier implements SerializableSupplier<Configuration> {
Review Comment:
I've opened https://github.com/apache/iceberg/pull/15583 to address this
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2921113803
##########
api/src/main/java/org/apache/iceberg/Scan.java:
##########
@@ -208,4 +209,13 @@ default ThisT minRowsRequested(long numRows) {
throw new UnsupportedOperationException(
this.getClass().getName() + " doesn't implement minRowsRequested");
}
+
+ /**
+ * The {@link FileIO} instance to use when reading data files for this scan.
+ *
+ * @return the {@link FileIO} instance to use when reading data files for this scan
+ */
+ default FileIO io() {
+ throw new UnsupportedOperationException("io() is not implemented: added in 1.11.0");
Review Comment:
I was thinking it could address urgent questions if you have deployed a new version of Iceberg and hit this, like "when was this added so I can roll back?" or "how long has this been broken?"
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2919390232
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -190,8 +192,9 @@ private CloseableIterable<FileScanTask> planTableScan(PlanTableScanRequest planT
this.planId = response.planId();
PlanStatus planStatus = response.planStatus();
- if (null != planId && !response.credentials().isEmpty()) {
- this.fileIOForPlanId = fileIOForPlanId(response.credentials());
+ if (null != planId) {
+ this.fileIOForPlanId =
+ !response.credentials().isEmpty() ? fileIOForPlanId(response.credentials()) : tableIo;
Review Comment:
after syncing up offline I've removed the if check around `planId` here, meaning that the FileIO will now always be configured when credentials are coming back in the response (and we'll add the `planId` as additional context if it's available)
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra merged PR #15561:
URL: https://github.com/apache/iceberg/pull/15561
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2927548872
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -170,7 +166,7 @@ public CloseableIterable<FileScanTask> planFiles() {
.withEndSnapshotId(endSnapshotId)
.withUseSnapshotSchema(true);
} else if (snapshotId != null) {
- boolean useSnapShotSchema = snapshotId != table.currentSnapshot().snapshotId();
+ boolean useSnapShotSchema = snapshotId != table().currentSnapshot().snapshotId();
Review Comment:
I don't think this is a blocker, but it doesn't look correct. Additional nit: "snapshot" is one word and should be capitalized "Snapshot".
@singhpk234, The snapshot schema should be used when time traveling to a tag or a specific snapshot ID, but not when reading from a branch. That context comes from how the ref or snapshot was configured. Choosing a specific snapshot should generally send useSnapshotSchema=true, but just reading from a branch should not. Here is the description from the REST spec:
> Whether to use the schema at the time the snapshot was written. When time travelling, the snapshot schema should be used (true). When scanning a branch, the table schema should be used (false).
This comparison isn't going to be sufficient because the distinction is whether the snapshot was selected via branch name vs directly by ID or by tag name. This needs to know whether `useRef` was called and whether the ref was a branch.
We also can't rely on comparing the result schema because `DataTableScan` (and its children) always override the schema to the branch/tag/snapshot schema and when `useSnapshot` or `useRef` are called. That's because the fields passed to `select` are applied lazily in `planFiles`. The snapshot/ref selection changes the base schema and columns are selected by name, or a specific projection is used directly.
To fix this, I think you need to override some of the API methods to detect how the scan is configured.
And while we're looking at schema projection, I think the projection code is also incorrect:
```java
List<String> selectedColumns =
schema().columns().stream().map(Types.NestedField::name).collect(Collectors.toList());
```
The problem here is that it will select top-level fields only because `NestedField#name` returns the local field's name and not any children. To get the full field names, you'd need to call `TypeUtil.getProjectedIds` and then pass each ID through `schema().findColumnName(id)` like you do for stats fields. This is what `SnapshotScan` does:
```java
List<Integer> projectedFieldIds = Lists.newArrayList(TypeUtil.getProjectedIds(schema()));
List<String> projectedFieldNames =
projectedFieldIds.stream().map(schema()::findColumnName).collect(Collectors.toList());
```
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913463575
##########
core/src/main/java/org/apache/iceberg/FileIOUtil.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.iceberg.hadoop.HadoopConfigurable;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.util.SerializableSupplier;
+
+public class SerializableFileIO {
+ private SerializableFileIO() {}
+
+ public static FileIO copyOf(FileIO fileIO) {
+ if (fileIO instanceof HadoopConfigurable) {
+ ((HadoopConfigurable) fileIO).serializeConfWith(SerializableConfSupplier::new);
+ }
+
+ return fileIO;
+ }
+
+ // captures the current state of a Hadoop configuration in a serializable manner
+ private static class SerializableConfSupplier implements SerializableSupplier<Configuration> {
Review Comment:
I'm on board with just making HadoopFileIO serializable with this kind of functionality built in. Seems like it would be simple enough to just make the configuration serializable or do a lazy init?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913366478
##########
core/src/main/java/org/apache/iceberg/SerializableFileIO.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.iceberg.hadoop.HadoopConfigurable;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.util.SerializableSupplier;
+
+public class SerializableFileIO {
+ private SerializableFileIO() {}
+
+ public static FileIO copyOf(FileIO fileIO) {
+ if (fileIO instanceof HadoopConfigurable) {
+ ((HadoopConfigurable) fileIO).serializeConfWith(SerializableConfSupplier::new);
+ }
+
+ return fileIO;
+ }
+
+ // captures the current state of a Hadoop configuration in a serializable manner
+ private static class SerializableConfSupplier implements SerializableSupplier<Configuration> {
Review Comment:
@aokolnychyi, do you think we can embed this in `HadoopFileIO`? I don't see a downside to doing that, but I might be missing something.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2921467152
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -85,7 +85,7 @@ class RESTTableScan extends DataTableScan {
private final Object hadoopConf;
private final FileIO tableIO;
private String planId = null;
- private FileIO fileIOForPlanId = null;
+ private FileIO scanFileIO = null;
Review Comment:
I'm looking at the information passed around in this class more based on having a couple of unnecessary fields and I have a few more questions:
Why does this use `Map<String, String> headers` rather than `Supplier<Map<String, String>> headers` that the table has? Doesn't this mean that the headers from the auth session are static? How does credential refresh work if the authentication header is stale?
Was the `TableOperations` field originally used? It isn't used now, other than to pass it to refined scans. I think it should be removed from both the constructor and the fields.
This passes `ResourcePaths` and `TableIdentifier` to build 2 paths that could be passed in a 1 path using the plan ID. I think this should be reconsidered. The plan and fetch endpoints can be passed in as simple strings, and it would simplify this to use a `Function<String, String>` to construct the plan path with ID. Another option is to create an object similar to `ResourcePaths` that is specific to a table (hides `TableIdentifier`) and use that. Either one would be cleaner.
This also passes `supportedEndpoints`, which spreads out the logic for how to handle endpoints that aren't supported. These endpoints are also checked when needed, so this code will create a plan request and could then fail to fetch tasks if the fetch endpoint isn't supported. It also throws error messages that are not helpful, like "Server does not support endpoint: GET /v1/{prefix}/namespaces/{namespace}/tables/{table}/plan/{plan-id}" instead of "Invalid status: submitted (service does not support async planning)" that would be more helpful.
A cleaner way to handle endpoints is to verify required endpoints before creating this scan. Both the plan and fetch endpoints should be required. Then the optional endpoint should be booleans, like `supportsAsync` and `supportsCancel`.
Last, this leaks catalog properties and the Hadoop conf so that `CatalogUtil.loadFileIO` can be called with `List<Credential>`. Why not pass a function to create the `FileIO` so that the properties and conf are contained in the REST table operations?
I think this works right now and these aren't blockers (other than the potential auth session issue), but I would really like to see this class simplified by reducing the number of things that have to be passed to it and remove some of the things that are done here, like handling endpoint checks.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2927555844
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -212,14 +213,17 @@ private CloseableIterable<FileScanTask> planTableScan(PlanTableScanRequest planT
}
}
- private FileIO fileIOForPlanId(List<Credential> storageCredentials) {
+ private FileIO scanFileIO(List<Credential> storageCredentials) {
+ ImmutableMap.Builder<String, String> builder =
+ ImmutableMap.<String, String>builder().putAll(catalogProperties);
+ if (null != planId) {
+ builder.put(RESTCatalogProperties.REST_SCAN_PLAN_ID, planId);
Review Comment:
Fixing in a separate PR is fine, but we don't want to replace one blocker with another endlessly as we find these issues.
We should also consider whether there are any alternatives to passing this mixed into catalog properties. Passing state like this in a property map along with config mixes concepts and causes weird API additions like this constant in `RESTCatalogProperties`.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2921312213
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -85,7 +85,7 @@ class RESTTableScan extends DataTableScan {
private final Object hadoopConf;
private final FileIO tableIO;
private String planId = null;
- private FileIO fileIOForPlanId = null;
+ private FileIO scanFileIO = null;
Review Comment:
The table's `FileIO` is not needed. It is passed in only once as `table.io()` and `table` is also passed in. And now that I'm looking at it, `table` not needed as a field because a parent (`BaseScan`) exposes `table()`. Both fields should be removed.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913352888
##########
core/src/main/java/org/apache/iceberg/SerializableFileIO.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.iceberg.hadoop.HadoopConfigurable;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.util.SerializableSupplier;
+
+public class SerializableFileIO {
+ private SerializableFileIO() {}
+
+ public static FileIO copyOf(FileIO fileIO) {
+ if (fileIO instanceof HadoopConfigurable) {
+ ((HadoopConfigurable) fileIO).serializeConfWith(SerializableConfSupplier::new);
+ }
+
+ return fileIO;
+ }
+
+ // captures the current state of a Hadoop configuration in a serializable manner
+ private static class SerializableConfSupplier implements SerializableSupplier<Configuration> {
Review Comment:
This is the main thing that needs to be used. Why not just always use this as part of `HadoopFileIO`? Then we don't need a util class or checking to wrap the `Configuration`. We would also not have unnecessary references to `Configuration` in classes that don't require it (meaning `SerializableTable`).
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913478663
##########
core/src/main/java/org/apache/iceberg/FileIOUtil.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.iceberg.hadoop.HadoopConfigurable;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.util.SerializableSupplier;
+
+public class SerializableFileIO {
+ private SerializableFileIO() {}
+
+ public static FileIO copyOf(FileIO fileIO) {
+ if (fileIO instanceof HadoopConfigurable) {
+ ((HadoopConfigurable) fileIO).serializeConfWith(SerializableConfSupplier::new);
+ }
+
+ return fileIO;
+ }
+
+ // captures the current state of a Hadoop configuration in a serializable manner
+ private static class SerializableConfSupplier implements SerializableSupplier<Configuration> {
Review Comment:
let me remove these changes from the PR then and I'll explore putting this into `HadoopFileIO` directly
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2922634002
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -212,14 +213,17 @@ private CloseableIterable<FileScanTask> planTableScan(PlanTableScanRequest planT
}
}
- private FileIO fileIOForPlanId(List<Credential> storageCredentials) {
+ private FileIO scanFileIO(List<Credential> storageCredentials) {
+ ImmutableMap.Builder<String, String> builder =
+ ImmutableMap.<String, String>builder().putAll(catalogProperties);
+ if (null != planId) {
+ builder.put(RESTCatalogProperties.REST_SCAN_PLAN_ID, planId);
Review Comment:
this hasn't been released and we can still change it, but this should most likely be done in a separate PR because that property is being used in a few other places as well
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913842659
##########
api/src/main/java/org/apache/iceberg/Scan.java:
##########
@@ -208,4 +209,13 @@ default ThisT minRowsRequested(long numRows) {
throw new UnsupportedOperationException(
this.getClass().getName() + " doesn't implement minRowsRequested");
}
+
+ /**
+ * The {@link FileIO} instance to use when reading data files for this scan.
+ *
+ * @return the {@link FileIO} instance to use when reading data files for this scan
+ */
+ default FileIO io() {
+ throw new UnsupportedOperationException("io() is not implemented: added in 1.11.0");
Review Comment:
I don't have a strong feeling here, are you thinking of this as a implementer facing message? I assume they won't really care when it's added, it's not like they can upgrade there way out of it. So i'll take it either way
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913418824
##########
core/src/main/java/org/apache/iceberg/SerializableTable.java:
##########
@@ -83,7 +80,7 @@ protected SerializableTable(Table table) {
Map<Integer, PartitionSpec> specs = table.specs();
specs.forEach((specId, spec) -> specAsJsonMap.put(specId, PartitionSpecParser.toJson(spec)));
this.sortOrderAsJson = SortOrderParser.toJson(table.sortOrder());
- this.io = fileIO(table);
+ this.io = SerializableFileIO.copyOf(table.io());
Review Comment:
We could add a flag to not serialize `FileIO` because it comes from the scan, but that probably isn't worth it. This is really just a problem for Hadoop and fixing `HadoopFileIO` serialization is enough.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2921320724
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -131,14 +131,16 @@ protected TableScan newRefinedScan(
tableIdentifier,
resourcePaths,
supportedEndpoints,
- io(),
+ null != scanFileIO ? scanFileIO : tableIO,
Review Comment:
The `io()` method checks whether `scanFileIO` is null and throws an exception, assuming that `scanFileIO` is only set from a call to `planFiles()`. This breaks that assumption because it will pass `tableIO` in its place, which is non-null.
The solution is to remove the constructor argument for `scanFileIO`. When a scan is further refined, its `scanFileIO` should not be passed on because the refined scan is a different scan.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913526537
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -131,14 +131,16 @@ protected TableScan newRefinedScan(
tableIdentifier,
resourcePaths,
supportedEndpoints,
- io(),
+ null != fileIOForPlanId ? fileIOForPlanId : tableIo,
catalogProperties,
hadoopConf);
}
@Override
- protected FileIO io() {
- return null != fileIOForPlanId ? fileIOForPlanId : tableIo;
+ public FileIO io() {
+ Preconditions.checkState(
+ null != fileIOForPlanId, "Invalid FileIO: planFiles() must be called first");
Review Comment:
This is confusing to me for a few reasons. Could we improve the message first in that
"Cannot X because Y" format?
Is this because we need the response from the planScan api to get credentials to init our filesystem?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913481051
##########
api/src/main/java/org/apache/iceberg/Scan.java:
##########
@@ -208,4 +209,13 @@ default ThisT minRowsRequested(long numRows) {
throw new UnsupportedOperationException(
this.getClass().getName() + " doesn't implement minRowsRequested");
}
+
+ /**
+ * The {@link FileIO} instance to use when reading data files for this scan.
+ *
+ * @return the {@link FileIO} instance to use when reading data files for this scan
+ */
+ default FileIO io() {
+ throw new UnsupportedOperationException("io() is not implemented: added in 1.11.0");
Review Comment:
Not sure the version belongs here
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2916261766
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -190,8 +192,9 @@ private CloseableIterable<FileScanTask> planTableScan(PlanTableScanRequest planT
this.planId = response.planId();
PlanStatus planStatus = response.planStatus();
- if (null != planId && !response.credentials().isEmpty()) {
- this.fileIOForPlanId = fileIOForPlanId(response.credentials());
+ if (null != planId) {
+ this.fileIOForPlanId =
+ !response.credentials().isEmpty() ? fileIOForPlanId(response.credentials()) : tableIo;
Review Comment:
> And why does it require a planId
the PlanID is added as additional context to the FileIO so that the server knows that these are credentials for remote scan planning when it needs to refresh them
> Why is this duplicated?
we have two separate responses that can return storage credentials
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2927130800
##########
api/src/main/java/org/apache/iceberg/Scan.java:
##########
@@ -208,4 +209,13 @@ default ThisT minRowsRequested(long numRows) {
throw new UnsupportedOperationException(
this.getClass().getName() + " doesn't implement minRowsRequested");
}
+
+ /**
+ * The {@link FileIO} instance to use when reading data files for this scan.
+ *
+ * @return the {@link FileIO} instance to use when reading data files for this scan
+ */
+ default FileIO io() {
+ throw new UnsupportedOperationException("io() is not implemented: added in 1.11.0");
Review Comment:
Who would that message be for though? I would think it's only for library integrators who would hopefully break immediately when they bump their dependency. I really don't mind though. We can keep it
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2921321576
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -190,9 +192,8 @@ private CloseableIterable<FileScanTask> planTableScan(PlanTableScanRequest planT
this.planId = response.planId();
PlanStatus planStatus = response.planStatus();
- if (null != planId && !response.credentials().isEmpty()) {
- this.fileIOForPlanId = fileIOForPlanId(response.credentials());
- }
+ this.scanFileIO =
+ !response.credentials().isEmpty() ? scanFileIO(response.credentials()) : tableIO;
Review Comment:
Should be `table().io()` rather than `tableIO`.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2922915921
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -85,7 +85,7 @@ class RESTTableScan extends DataTableScan {
private final Object hadoopConf;
private final FileIO tableIO;
private String planId = null;
- private FileIO fileIOForPlanId = null;
+ private FileIO scanFileIO = null;
Review Comment:
thanks @singhpk234 for opening https://github.com/apache/iceberg/pull/15595 to address those things
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2921341880
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -319,9 +322,9 @@ private CloseableIterable<FileScanTask> scanTasksIterable(
/** Cancels the plan on the server (if supported) and closes the plan-scoped FileIO */
private void cleanupPlanResources() {
cancelPlan();
- if (null != fileIOForPlanId) {
+ if (null != scanFileIO) {
FILEIO_TRACKER.invalidate(this);
- this.fileIOForPlanId = null;
+ this.scanFileIO = null;
Review Comment:
Why does this check whether `scanFileIO` is null? I think the tracker can always be invalidated and `scanFileIO` can always be set to null. Since those can be invariants of cleaning up, I think they should just run every time.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913496523
##########
api/src/main/java/org/apache/iceberg/Scan.java:
##########
@@ -208,4 +209,13 @@ default ThisT minRowsRequested(long numRows) {
throw new UnsupportedOperationException(
this.getClass().getName() + " doesn't implement minRowsRequested");
}
+
+ /**
+ * The {@link FileIO} instance to use when reading data files for this scan.
+ *
+ * @return the {@link FileIO} instance to use when reading data files for this scan
+ */
+ default FileIO io() {
+ throw new UnsupportedOperationException("io() is not implemented: added in 1.11.0");
Review Comment:
This is mostly for unexpected implementations, so I was thinking that a version number would be helpful like a deprecation message that has one. I'm fine removing it, though.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2905101622
##########
core/src/main/java/org/apache/iceberg/SerializableFileIO.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.iceberg.hadoop.HadoopConfigurable;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.util.SerializableSupplier;
+
+public class SerializableFileIO {
+ private SerializableFileIO() {}
+
+ public static FileIO copyOf(FileIO fileIO) {
+ if (fileIO instanceof HadoopConfigurable) {
Review Comment:
the whole functionality is just pulled out of `SerializableTable`
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2921312213
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -85,7 +85,7 @@ class RESTTableScan extends DataTableScan {
private final Object hadoopConf;
private final FileIO tableIO;
private String planId = null;
- private FileIO fileIOForPlanId = null;
+ private FileIO scanFileIO = null;
Review Comment:
The table's `FileIO` is not needed. It is passed in only once as `table.io()` and `table` is also passed in. And now that I'm looking at it, `table` not needed as a field because a parent (`BaseScan`) exposes `table()`. Both fields should be removed, along with the constructor argument for the table's IO.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2921337138
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -275,9 +279,8 @@ private CloseableIterable<FileScanTask> fetchPlanningResult() {
response.planStatus(),
planId);
- if (!response.credentials().isEmpty()) {
- this.fileIOForPlanId = fileIOForPlanId(response.credentials());
- }
+ this.scanFileIO =
+ !response.credentials().isEmpty() ? scanFileIO(response.credentials()) : tableIO;
Review Comment:
I'm not a fan of duplicating this. It should also be updated to use `table().io()`.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2916541418
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -275,9 +278,8 @@ private CloseableIterable<FileScanTask> fetchPlanningResult() {
response.planStatus(),
planId);
- if (!response.credentials().isEmpty()) {
- this.fileIOForPlanId = fileIOForPlanId(response.credentials());
- }
+ this.fileIOForPlanId =
+ !response.credentials().isEmpty() ? fileIOForPlanId(response.credentials()) : tableIo;
Review Comment:
done in https://github.com/apache/iceberg/pull/15582
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2921213228
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -212,14 +213,17 @@ private CloseableIterable<FileScanTask> planTableScan(PlanTableScanRequest planT
}
}
- private FileIO fileIOForPlanId(List<Credential> storageCredentials) {
+ private FileIO scanFileIO(List<Credential> storageCredentials) {
+ ImmutableMap.Builder<String, String> builder =
+ ImmutableMap.<String, String>builder().putAll(catalogProperties);
+ if (null != planId) {
+ builder.put(RESTCatalogProperties.REST_SCAN_PLAN_ID, planId);
Review Comment:
It makes no sense to me that the ID that we use to internally track the plan ID is a public field where we keep properties to configure the REST catalog. Is this something we can change or has it been released?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913423192
##########
core/src/main/java/org/apache/iceberg/FileIOUtil.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.iceberg.hadoop.HadoopConfigurable;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.util.SerializableSupplier;
+
+public class FileIOUtil {
+ private FileIOUtil() {}
+
+ public static FileIO wrap(FileIO fileIO) {
Review Comment:
This doesn't wrap the `FileIO`, it is the same instance. It just directs `HadoopFileIO` to serialize its configuration in a different way.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add FileIO to Scan API [iceberg]
Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #15561:
URL: https://github.com/apache/iceberg/pull/15561#discussion_r2913506963
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -275,9 +278,8 @@ private CloseableIterable<FileScanTask> fetchPlanningResult() {
response.planStatus(),
planId);
- if (!response.credentials().isEmpty()) {
- this.fileIOForPlanId = fileIOForPlanId(response.credentials());
- }
+ this.fileIOForPlanId =
+ !response.credentials().isEmpty() ? fileIOForPlanId(response.credentials()) : tableIo;
Review Comment:
Can you open a PR to fix the name of `tableIo`?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org