You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "swuferhong (via GitHub)" <gi...@apache.org> on 2023/09/15 07:55:26 UTC
[GitHub] [flink] swuferhong opened a new pull request, #23423: [FLINK-25993][table-planner] Skip redundant scan while partition table push down contains none-existent partition
swuferhong opened a new pull request, #23423:
URL: https://github.com/apache/flink/pull/23423
<!--
*Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
*Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
## Contribution Checklist
- Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
- Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
- Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
- Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
- Each pull request should address only one issue, not mix up code from multiple issues.
- Each commit in the pull request has a meaningful commit message (including the JIRA id)
- Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
**(The sections below can be removed for hotfixes of typos)**
-->
## What is the purpose of the change
This pr is aims to skip redundant scan while partition table contains none-existent partition. For this case, it means that there are no partitions are selected after partition prune. We can directly optimize the partition source Scan to Empty `FlinkLogicalValues`.
## Brief change log
- Adding empty check logic for `remianing partition` in `PushPartitionIntoTableSourceScanRule`.
- Add tests to cover the case in JIRA
## Verifying this change
- Add tests to cover the case in JIRA
## 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, Kubernetes/Yarn, 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? no docs
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] luoyuxia commented on pull request #23423: [FLINK-25593][table-planner] Skip redundant scan while partition table push down contains none-existent partition
Posted by "luoyuxia (via GitHub)" <gi...@apache.org>.
luoyuxia commented on PR #23423:
URL: https://github.com/apache/flink/pull/23423#issuecomment-1726945011
@swuferhong Thanks for the pr. But the test is failure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] swuferhong commented on pull request #23423: [FLINK-25593][table-planner] Skip redundant scan while partition table push down contains none-existent partition
Posted by "swuferhong (via GitHub)" <gi...@apache.org>.
swuferhong commented on PR #23423:
URL: https://github.com/apache/flink/pull/23423#issuecomment-1732835780
@flinkbot run azure
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] swuferhong commented on pull request #23423: [FLINK-25993][table-planner] Skip redundant scan while partition table push down contains none-existent partition
Posted by "swuferhong (via GitHub)" <gi...@apache.org>.
swuferhong commented on PR #23423:
URL: https://github.com/apache/flink/pull/23423#issuecomment-1722634630
> Is it possible the commit and PR title reference the wrong Jira issue? [FLINK-25993](https://issues.apache.org/jira/browse/FLINK-25993)'s title is "Option to disable Kryo.setRegistrationRequired(false)".
Hi, @shanebishop. Thanks for your reminder. I did make a mistake in linking issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] lsyldliu commented on pull request #23423: [FLINK-25593][table-planner] Skip redundant scan while partition table push down contains none-existent partition
Posted by "lsyldliu (via GitHub)" <gi...@apache.org>.
lsyldliu commented on PR #23423:
URL: https://github.com/apache/flink/pull/23423#issuecomment-1722974198
BTW, the CI is failed, please fix it first.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] swuferhong commented on pull request #23423: [FLINK-25593][table-planner] Skip redundant scan while partition table push down contains none-existent partition
Posted by "swuferhong (via GitHub)" <gi...@apache.org>.
swuferhong commented on PR #23423:
URL: https://github.com/apache/flink/pull/23423#issuecomment-1732820880
> @swuferhong Thanks for the pr. But the test is failure.
I will check it. Thanks @luoyuxia @lsyldliu .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-25593][table-planner] Skip redundant scan while partition table push down contains none-existent partition [flink]
Posted by "swuferhong (via GitHub)" <gi...@apache.org>.
swuferhong commented on code in PR #23423:
URL: https://github.com/apache/flink/pull/23423#discussion_r1351218921
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/PushPartitionIntoTableSourceScanRule.java:
##########
@@ -176,6 +177,14 @@ public void onMatch(RelOptRuleCall call) {
defaultPruner,
allPredicates._1(),
inputFieldNames);
+
+ // If remaining partitions are empty, it means that there are no partitions are selected
+ // after partition prune. We can directly optimize the RelNode to Empty FlinkLogicalValues.
+ if (remainingPartitions.isEmpty()) {
+ RelNode emptyValue = relBuilder.push(filter).empty().build();
Review Comment:
> Can it be `relBuilder.empty().build()`?
It must need a leaf node, otherwise the `NoSuchElementException` will be thrown.
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/PushPartitionIntoTableSourceScanRule.java:
##########
@@ -176,6 +177,14 @@ public void onMatch(RelOptRuleCall call) {
defaultPruner,
allPredicates._1(),
inputFieldNames);
+
+ // If remaining partitions are empty, it means that there are no partitions are selected
+ // after partition prune. We can directly optimize the RelNode to Empty FlinkLogicalValues.
+ if (remainingPartitions.isEmpty()) {
+ RelNode emptyValue = relBuilder.push(filter).empty().build();
+ call.transformTo(emptyValue);
Review Comment:
> return after this line?
Done!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] shanebishop commented on pull request #23423: [FLINK-25993][table-planner] Skip redundant scan while partition table push down contains none-existent partition
Posted by "shanebishop (via GitHub)" <gi...@apache.org>.
shanebishop commented on PR #23423:
URL: https://github.com/apache/flink/pull/23423#issuecomment-1722474775
Is it possible the commit and PR title reference the wrong Jira issue? [FLINK-25993](https://issues.apache.org/jira/browse/FLINK-25993)'s title is "Option to disable Kryo.setRegistrationRequired(false)".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #23423: [FLINK-25993][table-planner] Skip redundant scan while partition table push down contains none-existent partition
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #23423:
URL: https://github.com/apache/flink/pull/23423#issuecomment-1720844251
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "89fbe5c54823b821d9ad8ed5ef5f95535d6d6b49",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "89fbe5c54823b821d9ad8ed5ef5f95535d6d6b49",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 89fbe5c54823b821d9ad8ed5ef5f95535d6d6b49 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] swuferhong commented on pull request #23423: [FLINK-25593][table-planner] Skip redundant scan while partition table push down contains none-existent partition
Posted by "swuferhong (via GitHub)" <gi...@apache.org>.
swuferhong commented on PR #23423:
URL: https://github.com/apache/flink/pull/23423#issuecomment-1732872540
@flinkbot run azure
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-25593][table-planner] Skip redundant scan while partition table push down contains none-existent partition [flink]
Posted by "luoyuxia (via GitHub)" <gi...@apache.org>.
luoyuxia commented on code in PR #23423:
URL: https://github.com/apache/flink/pull/23423#discussion_r1351171194
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/PushPartitionIntoTableSourceScanRule.java:
##########
@@ -176,6 +177,14 @@ public void onMatch(RelOptRuleCall call) {
defaultPruner,
allPredicates._1(),
inputFieldNames);
+
+ // If remaining partitions are empty, it means that there are no partitions are selected
+ // after partition prune. We can directly optimize the RelNode to Empty FlinkLogicalValues.
+ if (remainingPartitions.isEmpty()) {
+ RelNode emptyValue = relBuilder.push(filter).empty().build();
Review Comment:
Can it be `relBuilder.empty().build()`?
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/PushPartitionIntoTableSourceScanRule.java:
##########
@@ -176,6 +177,14 @@ public void onMatch(RelOptRuleCall call) {
defaultPruner,
allPredicates._1(),
inputFieldNames);
+
+ // If remaining partitions are empty, it means that there are no partitions are selected
+ // after partition prune. We can directly optimize the RelNode to Empty FlinkLogicalValues.
+ if (remainingPartitions.isEmpty()) {
+ RelNode emptyValue = relBuilder.push(filter).empty().build();
+ call.transformTo(emptyValue);
Review Comment:
return after this line?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-25593][table-planner] Skip redundant scan while partition table push down contains none-existent partition [flink]
Posted by "luoyuxia (via GitHub)" <gi...@apache.org>.
luoyuxia merged PR #23423:
URL: https://github.com/apache/flink/pull/23423
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-25593][table-planner] Skip redundant scan while partition table push down contains none-existent partition [flink]
Posted by "swuferhong (via GitHub)" <gi...@apache.org>.
swuferhong commented on PR #23423:
URL: https://github.com/apache/flink/pull/23423#issuecomment-1754162270
> FLINK-27898
> @swuferhong Thanks for the pr. Overall, LGTM in code level. But I have one concern about it, in batch mode, it's total right to reduce the empty partition to a single Values node. But in stream mode, is it expected? I mean in optimize phase, no match partitions, but user expect to monitor the match partitions continuously. If reduce it to a single Values node, user will lose the ability. A similar issue it reported in [FLINK-27898](https://issues.apache.org/jira/browse/FLINK-27898).
Hi, @luoyuxia . I think it's another issue. The problem is that the partition we push down is static and has already been determined during optimize phase, for streaming mode, it will not work for some cases. However, I think these two issues need consider separately. Currently, this PR is only an optimization under the existing `SupportsPartitionPushDown`. If we want to better support partition push down in streaming mode, I think we need new flip and pr to improve the existing interface.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org