-
Notifications
You must be signed in to change notification settings - Fork 13k
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-25845][table] Introduce EXECUTE PLAN #18648
Conversation
919b0ba
to
88b2fd7
Compare
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 88b2fd7 (Mon Feb 07 15:10:09 UTC 2022) 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. 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 commandsThe @flinkbot bot supports the following commands:
|
7fac1d2
to
2e7e7a6
Compare
@flinkbot run azure |
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.
Very nice work @slinkydeveloper. I added some feedback.
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl
Outdated
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/dml/SqlExecutePlan.java
Show resolved
Hide resolved
...e-api-java/src/main/java/org/apache/flink/table/operations/command/ExecutePlanOperation.java
Outdated
Show resolved
Hide resolved
...-planner/src/test/java/org/apache/flink/table/api/internal/TableEnvironmentInternalTest.java
Outdated
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlCompilePlan.java
Outdated
Show resolved
Hide resolved
private SqlNode checkOperand(SqlNode operand) { | ||
if (!(operand instanceof RichSqlInsert || operand instanceof SqlStatementSet)) { | ||
throw new UnsupportedOperationException( | ||
"SqlCompilePlan supports only RichSqlInsert or SqlStatementSet as operand"); |
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.
Could a user see this? If yes, remove internal class names and write the exception like: COMPILE PLAN supports only INSERT INTO or STATEMENT SET definitions.
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.
No this happens only in case of a parser bug or a validator bug. The parser should not be able to parse at all a COMPILE (or a COMPILE AND EXECUTE) if the next AST nodes are not one of these two, because of this: https://github.com/apache/flink/pull/18648/files#diff-3aa4700ca748e2278129878cb20655276a6575183ef6a0b631a219106cf96491R1860-R1864
It would probably be better to use the assert
statement instead of UnsupportedOperationException
, but the reason i used it is for consistency.
...flink-sql-parser/src/main/java/org/apache/flink/sql/parser/dml/SqlCompileAndExecutePlan.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
if (!tableConfig.getConfiguration().get(TableConfigOptions.PLAN_FORCE_RECOMPILE)) { |
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.
Let's move this into compiledPlan.writeToFile
/into the planner? Then the force overwrite is valid everywhere.
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.
So I added a commit where now writeToFile
is consistent with this method. But still I wasn't able to unify them, as there is an essential difference here that while in the sql case i don't have an instance of CompiledPlan
already built and with the string value in it, while in table i have it. So i had to duplicate the logic in two different places.
...k-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java
Outdated
Show resolved
Hide resolved
...-planner/src/test/java/org/apache/flink/table/api/internal/TableEnvironmentInternalTest.java
Outdated
Show resolved
Hide resolved
…test execution Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
Signed-off-by: slinkydeveloper <francescoguard@gmail.com> [fixup] Add ExecutePlanOperation, implement and test it Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
…ement and test it Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
… AND EXECUTE PLAN parsing Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
…tion Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
…anITCase Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
… AND EXECUTE Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
2e7e7a6
to
44ffd07
Compare
Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
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, I had only a minor comment. I can address it while merging. Thanks.
|
||
``` | ||
mvn -Pgenerate-config-docs install | ||
mvn -Pgenerate-config-docs install -DskipTests -Dcheckstyle.skip -Drat.skip -Dscalastyle.skip -Denforcer.skip=true -Dspotless.check.skip=true -Dskip.npm=true -DskipITs=true -Dmaven.javadoc.skip=true -Djapicmp.skip=true |
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.
this might a bit too specific, who know what things we need to skip in the future. what we can suggest is -DskipTests -Dfast
that should be enough for most use cases, no?
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.
yep let's just use -dfast
What is the purpose of the change
Introduce
EXECUTE PLAN
statement.