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-13547][table-planner-blink] Verify and correct string function's semantic for Blink planner #9394

Closed
wants to merge 9 commits into from

Conversation

@docete
Copy link
Contributor

commented Aug 8, 2019

What is the purpose of the change

Currently many string builtin functions in blink planner follow hive/spark semantics, which should keep compatible with old planner. And some non-standard functions(Blink planner intros) should be removed.

Brief change log

  • concat/concat_ws function (null treatment)
  • substring function (follow calcite/flink)
  • from_base64 should return string not binary
  • intro truncate function to blink planner
  • uuid should be no-argument (remove the one-argument version)
  • length/jsonvalue/keyvalue/substr (non-standard function should be removed)
  • md5/sha1/sha2/sha224/sha256/sha384/sha512(remove the two-arguments version)
  • ascii (operand type should beSqlTypeFamily.CHARACTER)

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 / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
@flinkbot

This comment has been minimized.

Copy link

commented Aug 8, 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 8f45b9e (Fri Aug 23 10:15:29 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

This comment has been minimized.

Copy link

commented Aug 8, 2019

CI report:

Copy link
Member

left a comment

Thanks @docete , I left some suggestions.

  1. Remove "SUBSTR" builtin function definition and tests?
  2. Should "MD5" and "SHA" take SqlTypeFamily.CHARACTER instead of SqlTypeFamily.STRING ?
  3. Could you add a detailed description what builtin function are changed and the reason for commit "Refactor non-standard functions"? You can take 28260cd as an example.
  4. Add testInvalidTruncate1 and testInvalidTruncate2 to ScalarFunctionsValidationTest
  5. We should also support truncate TableAPI. Please add the following case to SqlExpressionTest#testArithmeticFunctions
    testSqlApi("truncate(42.345)", "42")
    testSqlApi("truncate(cast(42.345 as decimal(2, 3)), 2)", "42.34")

Btw, please add a prefix to the append commit message to describe which commit should be squashed into. For example: "fixup concat commit: fix test case". So that the committer can help to squash your commits easier.

@docete

This comment has been minimized.

Copy link
Contributor Author

commented Aug 9, 2019

Thanks @docete , I left some suggestions.

  1. Remove "SUBSTR" builtin function definition and tests?

Agree! Forgot to remove this non-standard function.

  1. Should "MD5" and "SHA" take SqlTypeFamily.CHARACTER instead of SqlTypeFamily.STRING ?

Sure. But now both Blink planner and old planner use SqlTypeFamily.STRING. I will open a new ticket to trace and fix both side.

  1. Could you add a detailed description what builtin function are changed and the reason for commit "Refactor non-standard functions"? You can take 28260cd as an example.

OK, will fix in next hours.

  1. Add testInvalidTruncate1 and testInvalidTruncate2 to ScalarFunctionsValidationTest

I don't understand. U mean put the decimal related truncate tests to a single test function?

  1. We should also support truncate TableAPI. Please add the following case to SqlExpressionTest#testArithmeticFunctions
    testSqlApi("truncate(42.345)", "42")
    testSqlApi("truncate(cast(42.345 as decimal(2, 3)), 2)", "42.34")

Btw, please add a prefix to the append commit message to describe which commit should be squashed into. For example: "fixup concat commit: fix test case". So that the committer can help to squash your commits easier.

OK, will fix in next hours.

@docete docete force-pushed the docete:FLINK-13547 branch from a423b9b to 4015a2b Aug 9, 2019
@wuchong
wuchong approved these changes Aug 9, 2019
Copy link
Member

left a comment

Thanks for the update @docete . The change looks good to me now.

I will squash and polish the commit message when I merge it.

Waiting travis to pass.

@wuchong

This comment has been minimized.

Copy link
Member

commented Aug 9, 2019

@wuchong wuchong closed this Aug 9, 2019
@docete docete deleted the docete:FLINK-13547 branch Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.