You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "ahmedabu98 (via GitHub)" <gi...@apache.org> on 2025/05/06 12:52:13 UTC
[PR] [IcebergIO] support selecting some fields to either keep or drop [beam]
ahmedabu98 opened a new pull request, #34856:
URL: https://github.com/apache/beam/pull/34856
Part of #34789
Allows users to pass a list of field names to either keep or drop when reading from an Iceberg table.
For example, say we have a table with columns `colA`, `colB`, `colC`, `colD`, `colE`. Either of the following will produce the same output:
- `keep: ["colA", "colE"]`
- `drop: ["colB", "colC", "colD"]`
`keep` and `drop` are mutually exclusive and an error will be thrown if both are specified
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [IcebergIO] support selecting some fields to either keep or drop [beam]
Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on code in PR #34856:
URL: https://github.com/apache/beam/pull/34856#discussion_r2076071065
##########
website/www/site/content/en/documentation/io/managed-io.md:
##########
@@ -180,6 +184,17 @@ manual updates or user intervention required!)
Properties passed to the Hadoop Configuration.
</td>
</tr>
+ <tr>
+ <td>
+ drop
+ </td>
+ <td>
+ <code>list[<span style="color: green;">str</span>]</code>
+ </td>
Review Comment:
only on Dataflow Runner V2 -- it'll fail if a user tries experimenting with any other runner + old SDK
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [IcebergIO] support selecting some fields to either keep or drop [beam]
Posted by "kennknowles (via GitHub)" <gi...@apache.org>.
kennknowles commented on code in PR #34856:
URL: https://github.com/apache/beam/pull/34856#discussion_r2076075983
##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/IcebergScanConfig.java:
##########
@@ -204,13 +233,33 @@ public Builder setTableIdentifier(String... names) {
public abstract Builder setBranch(@Nullable String branch);
+ public abstract Builder setKeepFields(@Nullable List<String> fields);
+
+ public abstract Builder setDropFields(@Nullable List<String> fields);
+
public abstract IcebergScanConfig build();
}
@VisibleForTesting
abstract Builder toBuilder();
void validate(Table table) {
+ @Nullable List<String> keep = getKeepFields();
+ @Nullable List<String> drop = getDropFields();
+ if (keep != null || drop != null) {
+ checkArgument(
+ keep == null || drop == null, error("only one of 'keep' or 'drop' can be set."));
+ Set<String> fieldsSpecified = Sets.newHashSet(checkNotNull(drop != null ? drop : keep));
Review Comment:
Readability nit: I honestly think just duping the code is easier to read. Since you have already done the `checkArgument`, just
```java
if (keep == null) {
fieldsSpecified = all the fields
} else {
fieldsSpecified = keep
}
if (drop != null) {
fieldsSpecified = fieldsSpecified setminus drop
}
```
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [IcebergIO] support selecting some fields to either keep or drop [beam]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #34856:
URL: https://github.com/apache/beam/pull/34856#issuecomment-2854932236
## [Codecov](https://app.codecov.io/gh/apache/beam/pull/34856?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 56.48%. Comparing base [(`4e6cbfc`)](https://app.codecov.io/gh/apache/beam/commit/4e6cbfc8bf5a9bed48ac6f87bef4e15f7b09a754?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`d9c3153`)](https://app.codecov.io/gh/apache/beam/commit/d9c3153f19f18806e143e2cffa2e0277bcb58643?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 13 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #34856 +/- ##
=========================================
Coverage 56.48% 56.48%
- Complexity 3299 3301 +2
=========================================
Files 1182 1182
Lines 181580 181555 -25
Branches 3409 3409
=========================================
- Hits 102559 102553 -6
+ Misses 75754 75738 -16
+ Partials 3267 3264 -3
```
| [Flag](https://app.codecov.io/gh/apache/beam/pull/34856/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [java](https://app.codecov.io/gh/apache/beam/pull/34856/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.59% <ø> (+0.02%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/beam/pull/34856?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [IcebergIO] Support column pruning [beam]
Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on PR #34856:
URL: https://github.com/apache/beam/pull/34856#issuecomment-2859158623
Please update CHANGES.md
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [IcebergIO] Support column pruning [beam]
Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #34856:
URL: https://github.com/apache/beam/pull/34856#issuecomment-2859867696
Ahh forgot to update CHANGES. I'll open another PR to do that
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [IcebergIO] support selecting some fields to either keep or drop [beam]
Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #34856:
URL: https://github.com/apache/beam/pull/34856#issuecomment-2855053054
assign set of reviewers
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [IcebergIO] support selecting some fields to either keep or drop [beam]
Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on code in PR #34856:
URL: https://github.com/apache/beam/pull/34856#discussion_r2075823825
##########
website/www/site/content/en/documentation/io/managed-io.md:
##########
@@ -180,6 +184,17 @@ manual updates or user intervention required!)
Properties passed to the Hadoop Configuration.
</td>
</tr>
+ <tr>
+ <td>
+ drop
+ </td>
+ <td>
+ <code>list[<span style="color: green;">str</span>]</code>
+ </td>
Review Comment:
do we need to specify the required Beam SDK version?
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [IcebergIO] support selecting some fields to either keep or drop [beam]
Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on code in PR #34856:
URL: https://github.com/apache/beam/pull/34856#discussion_r2076263888
##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/IcebergScanConfig.java:
##########
@@ -204,13 +233,33 @@ public Builder setTableIdentifier(String... names) {
public abstract Builder setBranch(@Nullable String branch);
+ public abstract Builder setKeepFields(@Nullable List<String> fields);
+
+ public abstract Builder setDropFields(@Nullable List<String> fields);
+
public abstract IcebergScanConfig build();
}
@VisibleForTesting
abstract Builder toBuilder();
void validate(Table table) {
+ @Nullable List<String> keep = getKeepFields();
+ @Nullable List<String> drop = getDropFields();
+ if (keep != null || drop != null) {
+ checkArgument(
+ keep == null || drop == null, error("only one of 'keep' or 'drop' can be set."));
+ Set<String> fieldsSpecified = Sets.newHashSet(checkNotNull(drop != null ? drop : keep));
Review Comment:
Thanks, 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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [IcebergIO] support selecting some fields to either keep or drop [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #34856:
URL: https://github.com/apache/beam/pull/34856#issuecomment-2855056869
Assigning reviewers. If you would like to opt out of this review, comment `assign to next reviewer`:
R: @m-trieu for label java.
R: @liferoad for label website.
Available commands:
- `stop reviewer notifications` - opt out of the automated review tooling
- `remind me after tests pass` - tag the comment author after tests pass
- `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
The PR bot will only process comments in the main thread (not review comments).
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [IcebergIO] support selecting some fields to either keep or drop [beam]
Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on code in PR #34856:
URL: https://github.com/apache/beam/pull/34856#discussion_r2075836448
##########
website/www/site/content/en/documentation/io/managed-io.md:
##########
@@ -180,6 +184,17 @@ manual updates or user intervention required!)
Properties passed to the Hadoop Configuration.
</td>
</tr>
+ <tr>
+ <td>
+ drop
+ </td>
+ <td>
+ <code>list[<span style="color: green;">str</span>]</code>
+ </td>
Review Comment:
Hmmm not sure how to do this considering the file is auto-generated. Maybe we can include it in the schema field's description but that doesn't seem very clean
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [IcebergIO] support selecting some fields to either keep or drop [beam]
Posted by "kennknowles (via GitHub)" <gi...@apache.org>.
kennknowles commented on code in PR #34856:
URL: https://github.com/apache/beam/pull/34856#discussion_r2076068510
##########
website/www/site/content/en/documentation/io/managed-io.md:
##########
@@ -180,6 +184,17 @@ manual updates or user intervention required!)
Properties passed to the Hadoop Configuration.
</td>
</tr>
+ <tr>
+ <td>
+ drop
+ </td>
+ <td>
+ <code>list[<span style="color: green;">str</span>]</code>
+ </td>
Review Comment:
Won't it work, even on SDKs that don't understand it yet?
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [IcebergIO] Support column pruning [beam]
Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #34856:
URL: https://github.com/apache/beam/pull/34856#issuecomment-2859862634
Thanks Kenn
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [IcebergIO] Support column pruning [beam]
Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 merged PR #34856:
URL: https://github.com/apache/beam/pull/34856
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org