-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-15430][table-planner-blink] Fix Java 64K method compiling limi… #10737
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-15430][table-planner-blink] Fix Java 64K method compiling limi… #10737
Conversation
…tation for blink planner
|
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit fdd8856 (Wed Jan 01 15:59:34 UTC 2020) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. DetailsThe 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 commandsThe @flinkbot bot supports the following commands:
|
CI report:
Bot commandsThe @flinkbot bot supports the following commands:
|
|
@flinkbot run travis |
|
cc @JingsongLi |
JingsongLi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @libenchao , left two thought:
- Can we just copy codes from legacy planner? It seems that there are some corner cases in
CodeGenerator.makeReusableInSplits. - If we just have some codes like
boolean $myNullTerm = ..., will lead to compile exception after code splitting?
|
@JingsongLi Thanks for the review.
|
This reverts commit 263bb0c.
|
@JingsongLi @wuchong I go over the implementation again, and find that it indeed has many corner cases.
So, it's indeed not easy to do code split currently. And I propose to narrow down the scope of this simple fix, which just targets long projection list. Then we can just focus on |
|
@libenchao Thanks for you updating.
Good job!
+1 |
| val methodName = newName("split") | ||
| val method = | ||
| s""" | ||
| |private void $methodName() throw Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throws
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review, fixed.
|
This temporary fixing looks good to me. Now we limit this fixing to the Calc only. It's not a perfect solution. But it does solve the problem. @wuchong @KurtYoung What do you think? |
wuchong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @libenchao @JingsongLi . I'm fine with current temporary solution.
I only left a minor comment about the method naming.
| /** | ||
| * Flag indicating whether split has occurred. | ||
| */ | ||
| private var isSplit = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename the variable to isCodeSplit to make it clear that the code is splitted?
The comment can also be improved Flag that indicates whether the generated code is split into several methods.
| reusableLocalVariableStatements(methodName) = mutable.LinkedHashSet[String]() | ||
| } | ||
|
|
||
| def setSplit(): Unit = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enableCodeSplit() or setCodeSplit()? Please also add Javadoc above this method.
|
@wuchong Thanks for the review. I've updated the code. |
wuchong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
…o prevent compiler exceptions (#10737)
…tation for blink planner
What is the purpose of the change
Fix blink planner code generation exceeds 64k java method limitation.
Brief change log
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
@Public(Evolving): (yes / no)Documentation