Skip to content

Conversation

@twalthr
Copy link
Contributor

@twalthr twalthr commented Sep 18, 2020

What is the purpose of the change

Adds all @PublicEvolving interfaces mentioned in FLIP-107.

Brief change log

  • Updated EncodingFormat and DecodingFormat
  • Added SupportsReadingMetadata and SupportsWritingMetadata

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): yes
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? JavaDocs

@flinkbot
Copy link
Collaborator

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 8e458c0 (Fri Sep 18 13:03:06 UTC 2020)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.

Details
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Sep 18, 2020

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@aljoscha aljoscha left a comment

Choose a reason for hiding this comment

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

Approved, but I had some suggestions for wording.

import java.util.Map;

/**
* Enables to write metadata columns to a {@link DynamicTableSink}.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe Interface for {@link DynamicTableSink DynamicTableSinks} that support writing metadata columns. sounds better.

Comment on lines 37 to 39
* <p>Metadata columns add additional columns to the table's schema. A table sink is responsible to
* accept requested metadata columns at the end of consumed rows and persist them. This includes potentially
* forwarding metadata columns to contained formats.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* <p>Metadata columns add additional columns to the table's schema. A table sink is responsible to
* accept requested metadata columns at the end of consumed rows and persist them. This includes potentially
* forwarding metadata columns to contained formats.
* <p>Metadata columns add additional columns to the table's schema. A table sink is responsible for
* accepting requested metadata columns at the end of consumed rows and persist them. This includes potentially
* forwarding metadata columns to contained formats.

import java.util.Map;

/**
* Enables to read metadata columns from a {@link ScanTableSource}.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe Interface for {@link ScanTableSource ScanTableSources} that support reading metadata columns. sounds better.

Comment on lines 39 to 41
* <p>Metadata columns add additional columns to the table's schema. A table source is responsible to
* add requested metadata columns at the end of produced rows. This includes potentially forwarding metadata
* columns from contained formats.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* <p>Metadata columns add additional columns to the table's schema. A table source is responsible to
* add requested metadata columns at the end of produced rows. This includes potentially forwarding metadata
* columns from contained formats.
* <p>Metadata columns add additional columns to the table's schema. A table source is responsible for
* adding requested metadata columns at the end of produced rows. This includes potentially forwarding metadata
* columns from contained formats.

*
* @see DecodingFormat#listReadableMetadata()
*/
Map<String, DataType> listReadableMetadata();
Copy link
Contributor

Choose a reason for hiding this comment

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

Returning a Map might be a bit dangerous when the order is important. A List of tuples would seem better. But I'm sure this was discussed in the FLIP. So please ignore... 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The order of the Map is not super important. In the end, the passed List decides about the order. But an implementation can sync both methods and avoid index mapping if desired.

@twalthr twalthr closed this in 048c89a Sep 22, 2020
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.

4 participants