You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Revanth14 (via GitHub)" <gi...@apache.org> on 2026/10/12 19:02:29 UTC
[PR] Core: Use the scan filter when a REST scan task omits residual-filter [iceberg]
Revanth14 opened a new pull request, #18472:
URL: https://github.com/apache/iceberg/pull/18472
Fixes #18471.
## Problem
`residual-filter` is optional on `FileScanTask`, and the spec says the client must then produce the residual or use the original filter. `RESTFileScanTaskParser` instead built the task's `ResidualEvaluator` from a null filter, so `residual()` threw a NullPointerException for partitioned specs and returned null for unpartitioned ones.
## Fix
`RESTTableScan` passes its filter to the scan response deserializers as a `scanFilter` injectable, alongside `specsById` and `caseSensitive`. A task without `residual-filter` gets its residual from that filter and the task's partition, as local planning computes it. An explicit `residual-filter` still takes precedence.
`TableScanResponseParser.parseFileScanTasks` and the `fromJson(JsonNode, ...)` methods of the plan, fetch-planning-result and fetch-scan-tasks response parsers gain overloads taking the scan filter; the existing signatures are unchanged.
`scanFilter` is required like the other injectables: Jackson fails on any missing injectable, so code that deserializes scan responses with its own injectables must now supply it.
## Tests
- `TestTableScanResponseParser`: a partitioned task without `residual-filter` gets the residual derived from the scan filter (NPE before this change), and an explicit residual takes precedence.
- Existing `TestRESTScanPlanning` cases now deserialize through the required `scanFilter`, covering the `RESTTableScan` wiring.
--
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] Core: Use the scan filter when a REST scan task omits residual-filter [iceberg]
Posted by "Revanth14 (via GitHub)" <gi...@apache.org>.
Revanth14 commented on code in PR #18472:
URL: https://github.com/apache/iceberg/pull/18472#discussion_r4253519265
##########
core/src/main/java/org/apache/iceberg/rest/responses/FetchPlanningResultResponseParser.java:
##########
@@ -92,6 +93,18 @@ static FetchPlanningResultResponse fromJson(
public static FetchPlanningResultResponse fromJson(
JsonNode json, Map<Integer, PartitionSpec> specsById, boolean caseSensitive) {
+ return fromJson(json, specsById, caseSensitive, null);
+ }
Review Comment:
Agreed, Deprecated them.
--
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] Core: Use the scan filter when a REST scan task omits residual-filter [iceberg]
Posted by "Revanth14 (via GitHub)" <gi...@apache.org>.
Revanth14 commented on code in PR #18472:
URL: https://github.com/apache/iceberg/pull/18472#discussion_r4253523843
##########
core/src/main/java/org/apache/iceberg/rest/RESTFileScanTaskParser.java:
##########
@@ -94,7 +95,10 @@ public static FileScanTask fromJson(
deleteFiles = indices.stream().map(allDeleteFiles::get).toArray(DeleteFile[]::new);
}
- Expression filter = null;
+ // A missing residual-filter is allowed by the spec, and the client must then produce the
+ // residual: the ResidualEvaluator below derives it from the scan filter and the task's
+ // partition.
Review Comment:
agreed, updated the comment.
--
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] Core: Use the scan filter when a REST scan task omits residual-filter [iceberg]
Posted by "Revanth14 (via GitHub) via issues" <is...@iceberg.apache.org>.
Revanth14 commented on PR #18472:
URL: https://github.com/apache/iceberg/pull/18472#issuecomment-6830682737
@singhpk234
Hi Prasanth, can you please look into this when you got time.
Thanks
--
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] Core: Use the scan filter when a REST scan task omits residual-filter [iceberg]
Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 commented on code in PR #18472:
URL: https://github.com/apache/iceberg/pull/18472#discussion_r4253234790
##########
core/src/main/java/org/apache/iceberg/rest/responses/FetchScanTasksResponseParser.java:
##########
@@ -69,12 +70,25 @@ static FetchScanTasksResponse fromJson(
public static FetchScanTasksResponse fromJson(
JsonNode json, Map<Integer, PartitionSpec> specsById, boolean caseSensitive) {
+ return fromJson(json, specsById, caseSensitive, null);
+ }
Review Comment:
same here
##########
core/src/main/java/org/apache/iceberg/rest/responses/FetchPlanningResultResponseParser.java:
##########
@@ -92,6 +93,18 @@ static FetchPlanningResultResponse fromJson(
public static FetchPlanningResultResponse fromJson(
JsonNode json, Map<Integer, PartitionSpec> specsById, boolean caseSensitive) {
+ return fromJson(json, specsById, caseSensitive, null);
+ }
Review Comment:
should we mark this deprecated then ?
##########
core/src/main/java/org/apache/iceberg/rest/TableScanResponseParser.java:
##########
@@ -66,6 +67,19 @@ public static List<FileScanTask> parseFileScanTasks(
List<DeleteFile> deleteFiles,
Map<Integer, PartitionSpec> specsById,
boolean caseSensitive) {
+ return parseFileScanTasks(node, deleteFiles, specsById, caseSensitive, null);
+ }
Review Comment:
same here : can we mark this deprecated ?
##########
core/src/main/java/org/apache/iceberg/rest/RESTFileScanTaskParser.java:
##########
@@ -94,7 +95,10 @@ public static FileScanTask fromJson(
deleteFiles = indices.stream().map(allDeleteFiles::get).toArray(DeleteFile[]::new);
}
- Expression filter = null;
+ // A missing residual-filter is allowed by the spec, and the client must then produce the
+ // residual: the ResidualEvaluator below derives it from the scan filter and the task's
+ // partition.
Review Comment:
wouldn't it be simpler if we say, use the scanFilter if the residual is missing ?
--
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] Core: Use the scan filter when a REST scan task omits residual-filter [iceberg]
Posted by "Revanth14 (via GitHub)" <gi...@apache.org>.
Revanth14 commented on code in PR #18472:
URL: https://github.com/apache/iceberg/pull/18472#discussion_r4253521388
##########
core/src/main/java/org/apache/iceberg/rest/responses/FetchScanTasksResponseParser.java:
##########
@@ -69,12 +70,25 @@ static FetchScanTasksResponse fromJson(
public static FetchScanTasksResponse fromJson(
JsonNode json, Map<Integer, PartitionSpec> specsById, boolean caseSensitive) {
+ return fromJson(json, specsById, caseSensitive, null);
+ }
Review Comment:
Agreed, Deprecated them.
##########
core/src/main/java/org/apache/iceberg/rest/TableScanResponseParser.java:
##########
@@ -66,6 +67,19 @@ public static List<FileScanTask> parseFileScanTasks(
List<DeleteFile> deleteFiles,
Map<Integer, PartitionSpec> specsById,
boolean caseSensitive) {
+ return parseFileScanTasks(node, deleteFiles, specsById, caseSensitive, null);
+ }
Review Comment:
Done
--
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