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-13318][table-planner-blink] Fix Blink planner tests failing on Scala 2.12 by setting SerialVersionUID of UDF explicitly #9193

Closed
wants to merge 1 commit into from

Conversation

beyond1920
Copy link
Contributor

What is the purpose of the change

Fix Blink planner tests failing on Scala 2.12. Some query plan in Scala 2.12 is different with that in Scala 2.11 if it contains udf without SerialVersionUID explicitly.

Brief change log

Add SerialVersionUID for all UserDefinedFunctions in blink planner which is Scala language.

Verifying this change

Existed UT, IT

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): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, 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 Jul 22, 2019

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 c49cd6f (Tue Aug 06 15:45:52 UTC 2019)

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.


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 Jul 22, 2019

CI report:

Copy link
Member

@wuchong wuchong left a comment

Choose a reason for hiding this comment

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

Thanks @beyond1920 , Overall looks good to me.

Can you rename the title to align with the root cause?

@beyond1920 beyond1920 changed the title [FLINK-13318][table-planner-blink] Fix Blink planner tests failing on Scala 2.12 [FLINK-13318][table-planner-blink] Fix Blink planner tests failing on Scala 2.12 by setting SerialVersionUID explicitly Jul 22, 2019
@beyond1920 beyond1920 changed the title [FLINK-13318][table-planner-blink] Fix Blink planner tests failing on Scala 2.12 by setting SerialVersionUID explicitly [FLINK-13318][table-planner-blink] Fix Blink planner tests failing on Scala 2.12 by setting SerialVersionUID of UDF explicitly Jul 22, 2019
@beyond1920
Copy link
Contributor Author

@wuchong Updated title. Thanks

@twalthr
Copy link
Contributor

twalthr commented Jul 22, 2019

@beyond1920 why are only Blink tests affected by this? We also have Scala functions without version ID. Actually I doubt if we should force users to set this. We are not really using it because the serialization is only for shipping to the cluster.

@wuchong
Copy link
Member

wuchong commented Jul 23, 2019

Hi @twalthr , this is because

  1. we print the udf's md5 into the node explanation.
  2. blink planner uses xml to verify plan, the xml content is immutable between different Scala versions.
  3. the serialization behavior is different between Scala 2.11 and 2.12 when version id is not defined.

That's why we add version id to all existing scala udfs. But this doesn't mean we force users to set this. This is just a workaround for the plan test for different Scala versions. Users can still use a Scala udf without version id in blink planner and flink planner.

why are only Blink tests affected by this?

Flink uses "${func.functionIdentifier}" to generate plan content, so that it can adapt to different Scala versions automatically.

@beyond1920
Copy link
Contributor Author

+1 to wuchong's opinion.
In fact, we don't need to force users to set serializationId.
We only need to add SerialVersionUID to UDF in plan tests, in order to generate a stable xml plan.

@twalthr
Copy link
Contributor

twalthr commented Jul 23, 2019

Thanks for the explanation @wuchong. +1 to the changes from my side.

Copy link
Member

@wuchong wuchong left a comment

Choose a reason for hiding this comment

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

LGTM.

@asfgit asfgit closed this in 898b190 Jul 23, 2019
asfgit pushed a commit that referenced this pull request Jul 23, 2019
… Scala 2.12 by setting SerialVersionUID to Scala UDFs

This is because:

1. we print the udf's md5 into the node explanation
2. blink planner uses XML to verify plan, the XML content is immutable between different Scala versions
3. the serialization behavior is different between Scala 2.11 and 2.12 when version id is not defined.

That's why we add version id to all existing scala udfs. But this doesn't mean we force users to set this. This is just a workaround for the plan test for different Scala versions. Users can still use a Scala udf without version id in blink planner and flink planner.

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