Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Java documentation to IcebergIO #32621

Merged
merged 3 commits into from
Oct 2, 2024
Merged

Conversation

ahmedabu98
Copy link
Contributor

No description provided.

Copy link
Contributor

github-actions bot commented Oct 2, 2024

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

@github-actions github-actions bot added the build label Oct 2, 2024
@@ -54,7 +54,7 @@ public class IcebergWriteSchemaTransformProvider
extends TypedSchemaTransformProvider<Configuration> {

static final String INPUT_TAG = "input";
static final String OUTPUT_TAG = "output";
static final String SNAPSHOTS_TAG = "snapshots";
Copy link
Contributor Author

@ahmedabu98 ahmedabu98 Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change that I'm comfortable with because I doubt anyone is fetching snapshots right now (and if they are, they're using .getSinglePcollection() because this tag name is not discoverable yet). I'd like to take the opportunity to give snapshots a more accurate tag and make room for a potential DLQ in the future

@@ -69,7 +70,7 @@ public Row toRow() {
try {
SchemaRegistry registry = SchemaRegistry.createDefault();
CODER = registry.getSchemaCoder(SnapshotInfo.class);
SCHEMA = registry.getSchema(SnapshotInfo.class).sorted();
SCHEMA = registry.getSchema(SnapshotInfo.class).sorted().toSnakeCase();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another breaking change that I'm comfortable with. Better to unify everything to snake case format.

@ahmedabu98
Copy link
Contributor Author

assign set of reviewers

Copy link
Contributor

github-actions bot commented Oct 2, 2024

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @robertwb for label java.
R: @Abacn for label build.
R: @Abacn for label io.

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

Copy link
Contributor

@chamikaramj chamikaramj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM.

* <pre>{@code
* Map<String, Object> config = Map.of(
* "table", table,
* "triggering_frequency_seconds", 5,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these details regarding using "Managed" transform for various sources/sinks such as Iceberg should also be in the Website. May be we can also remove it from here (to avoid duplication) once we have these details in a central place. It feels bit odd to have documentation in a class that we do not want users to use directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that Managed transforms should have a central place -- there are docs that serve this purpose for Dataflow. There isn't any Beam documentation for using IcebergIO though.

It feels bit odd to have documentation in a class that we do not want users to use directly

The class is publicly available for ppl to use (I think this was a prior mistake on our part, we should've kept it package private).

I was thinking if users discover this class, at least they have some clear documentation that drives them towards using the Managed interface.

* pipeline
* .apply(Create.of(BEAM_ROWS))
* .apply(Managed.write(ICEBERG).withConfig(config))
* .get("snapshots")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use the SNAPSHOTS_TAG constant here ?

Copy link
Contributor Author

@ahmedabu98 ahmedabu98 Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users would have to access it using IcebergWriteSchemaTransformProvider.SNAPSHOTS_TAG, which might be a little too low-level. I think it's better to insulate users from going that deep

Copy link
Contributor

@Abacn Abacn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Generated the javadoc locally and looks good. Just caught a minor formatting thing

@ahmedabu98 ahmedabu98 merged commit bb09de7 into apache:master Oct 2, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants