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

[FLINK-18090] Update the Row.toString method #14568

Closed
wants to merge 2 commits into from

Conversation

twalthr
Copy link
Contributor

@twalthr twalthr commented Jan 6, 2021

What is the purpose of the change

This updates the Row.toString method to provide a good summary string.

In particular it fixes the following issues:

  • Changeflag: According to FLIP-95, a row describes an entry in a changelog. Therefore, it should visible whether a row is an insert, delete, or update change. Now indicated with +I, -D, +U, -U.
  • Nested rows: In the old implementation it was not visible whether nested rows exist or not due to missing start/end boundaries. Now indicated with [...] or {...}.
  • Positioned rows vs. named rows: According to FLIP-136, it should be visible whether a row operates in name-based or position-based field mode. Now indicated with [...] or {...}.
  • Nested arrays in maps and lists: In the old implementation arrays in maps or lists could not be represented.
  • Wrong formatting: Most programming languages use a space after a comma.

Brief change log

Because this change might cause issues for tests, we provide a flag in RowUtils for legacy mode and a JUnit rule to make the migration incremental.

All tests in modules apart from the Blink planner/runtime module have been updated.

Verifying this change

This change is already covered by existing tests.

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

  • Dependencies (does it add or upgrade a dependency): yes
  • 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? no
  • If yes, how is the feature documented? not applicable

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 6, 2021

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 7b8a1e7 (Fri May 28 07:02:10 UTC 2021)

Warnings:

  • 1 pom.xml files were touched: Check for build and licensing issues.
  • 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.


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 Jan 6, 2021

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

@dawidwys dawidwys self-assigned this Jan 6, 2021
Copy link
Contributor

@dawidwys dawidwys left a comment

Choose a reason for hiding this comment

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

+1 % Azure

@@ -74,6 +74,8 @@ public static boolean compareRows(List<Row> l1, List<Row> l2, boolean ignoreOrde
// Internal utilities
// --------------------------------------------------------------------------------------------

public static boolean USE_LEGACY_TO_STRING = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a note it should be used only in tests?

@twalthr twalthr changed the title Update the Row.toString method [FLINK-18090] Update tests for new Row.toString Jan 7, 2021
@twalthr twalthr changed the title [FLINK-18090] Update tests for new Row.toString [FLINK-18090] Update the Row.toString method Jan 7, 2021
This updates the Row.toString method to provide a good summary string.

In particular it fixes the following issues:

Changeflag: According to FLIP-95, a row describes an entry in a
changelog. Therefore, it should visible whether a row is an insert,
delete, or update change. Now indicated with +I, -D, +U, -U.

Nested rows: In the old implementation it was not visible whether nested
rows exist or not due to missing start/end boundaries. Now indicated with
[...] or {...}.

Positioned rows vs. named rows: According to FLIP-136, it should be visible
whether a row operates in name-based or position-based field mode. Now
indicated with [...] or {...}.

Nested arrays in maps and lists: In the old implementation arrays in maps
or lists could not be represented.

Wrong formatting: Most programming languages use a space after a comma.

This is an incompatible change. If the legacy representation is still
required for tests, the old behavior can be restored via the flag
RowUtils.USE_LEGACY_TO_STRING for the local JVM. However, relying on
the row's string representation for tests is not a good idea in general as
field data types are not verified.
All tests in modules apart from the Blink planner/runtime
module have been updated.

Otherwise we use a JUnit rule to make the migration of
the remaining tests incremental.

This closes apache#14568.
@twalthr twalthr closed this in 73cdd3d Jan 7, 2021
jnh5y pushed a commit to jnh5y/flink that referenced this pull request Dec 18, 2023
All tests in modules apart from the Blink planner/runtime
module have been updated.

Otherwise we use a JUnit rule to make the migration of
the remaining tests incremental.

This closes apache#14568.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants