You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/08/30 13:14:42 UTC
[GitHub] [flink] lincoln-lil opened a new pull request, #20717: [FLINK-29138][table-planner] fix project can not be pushed into lookup source
lincoln-lil opened a new pull request, #20717:
URL: https://github.com/apache/flink/pull/20717
## What is the purpose of the change
Projected pushdown is a basic optimization for table source , but actually not work for lookup source (which implments `SupportsProjectionPushDown`), this is unexpected, we should fix this.
## Brief change log
Add a new rule `ProjectSnapshotTransposeRule` for both batch and stream rule sets
## Verifying this change
- newly added `ProjectSnapshotTransposeRuleTest` to cover both batch and streaming mode
- existing LookupJoinTest
## 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)
--
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] Aitozi commented on a diff in pull request #20717: [FLINK-29138][table-planner] fix project can not be pushed into lookup source
Posted by GitBox <gi...@apache.org>.
Aitozi commented on code in PR #20717:
URL: https://github.com/apache/flink/pull/20717#discussion_r959137205
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/ProjectSnapshotTransposeRule.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.plan.rules.logical;
+
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.plan.RelRule;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.logical.LogicalProject;
+import org.apache.calcite.rel.logical.LogicalSnapshot;
+import org.apache.calcite.rex.RexOver;
+
+/** Transpose {@link LogicalProject} past into {@link LogicalSnapshot}. */
+public class ProjectSnapshotTransposeRule extends RelRule<ProjectSnapshotTransposeRule.Config> {
+
+ public static final RelOptRule INSTANCE =
+ ProjectSnapshotTransposeRule.Config.EMPTY.as(Config.class).withOperator().toRule();
+
+ public ProjectSnapshotTransposeRule(Config config) {
+ super(config);
+ }
+
+ @Override
+ public boolean matches(RelOptRuleCall call) {
+ LogicalProject project = call.rel(0);
+ return project.getProjects().stream().noneMatch(RexOver::containsOver);
Review Comment:
thanks for your explanation. One more minor comment here, it seems can directly use `!project.containsOver()`
--
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] lincoln-lil commented on pull request #20717: [FLINK-29138][table-planner] fix project can not be pushed into lookup source
Posted by GitBox <gi...@apache.org>.
lincoln-lil commented on PR #20717:
URL: https://github.com/apache/flink/pull/20717#issuecomment-1233008395
@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] flinkbot commented on pull request #20717: [FLINK-29138][table-planner] fix project can not be pushed into lookup source
Posted by GitBox <gi...@apache.org>.
flinkbot commented on PR #20717:
URL: https://github.com/apache/flink/pull/20717#issuecomment-1231661792
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fd8bdcdcd9d81113a22756bd495e802c7ab7d13b",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "fd8bdcdcd9d81113a22756bd495e802c7ab7d13b",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* fd8bdcdcd9d81113a22756bd495e802c7ab7d13b 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] JingsongLi merged pull request #20717: [FLINK-29138][table-planner] fix project can not be pushed into lookup source
Posted by GitBox <gi...@apache.org>.
JingsongLi merged PR #20717:
URL: https://github.com/apache/flink/pull/20717
--
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] Aitozi commented on a diff in pull request #20717: [FLINK-29138][table-planner] fix project can not be pushed into lookup source
Posted by GitBox <gi...@apache.org>.
Aitozi commented on code in PR #20717:
URL: https://github.com/apache/flink/pull/20717#discussion_r958637551
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/ProjectSnapshotTransposeRule.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.plan.rules.logical;
+
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.plan.RelRule;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.logical.LogicalProject;
+import org.apache.calcite.rel.logical.LogicalSnapshot;
+import org.apache.calcite.rex.RexOver;
+
+/** Transpose {@link LogicalProject} past into {@link LogicalSnapshot}. */
+public class ProjectSnapshotTransposeRule extends RelRule<ProjectSnapshotTransposeRule.Config> {
+
+ public static final RelOptRule INSTANCE =
+ ProjectSnapshotTransposeRule.Config.EMPTY.as(Config.class).withOperator().toRule();
+
+ public ProjectSnapshotTransposeRule(Config config) {
+ super(config);
+ }
+
+ @Override
+ public boolean matches(RelOptRuleCall call) {
+ LogicalProject project = call.rel(0);
+ return project.getProjects().stream().noneMatch(RexOver::containsOver);
Review Comment:
Hi @lincoln-lil , just jumping into this PR, can you help me understand why here need to check for the `RexOver` ?
--
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] lincoln-lil commented on pull request #20717: [FLINK-29138][table-planner] fix project can not be pushed into lookup source
Posted by GitBox <gi...@apache.org>.
lincoln-lil commented on PR #20717:
URL: https://github.com/apache/flink/pull/20717#issuecomment-1233627474
@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] lincoln-lil commented on pull request #20717: [FLINK-29138][table-planner] fix project can not be pushed into lookup source
Posted by GitBox <gi...@apache.org>.
lincoln-lil commented on PR #20717:
URL: https://github.com/apache/flink/pull/20717#issuecomment-1233631619
an unstable connector case: https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=40566&view=ms.vss-test-web.build-test-results-tab
successed in my own pipeline: https://dev.azure.com/lincoln86xy/lincoln86xy/_build/results?buildId=250&view=results
--
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] lincoln-lil commented on a diff in pull request #20717: [FLINK-29138][table-planner] fix project can not be pushed into lookup source
Posted by GitBox <gi...@apache.org>.
lincoln-lil commented on code in PR #20717:
URL: https://github.com/apache/flink/pull/20717#discussion_r959071226
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/ProjectSnapshotTransposeRule.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.plan.rules.logical;
+
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.plan.RelRule;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.logical.LogicalProject;
+import org.apache.calcite.rel.logical.LogicalSnapshot;
+import org.apache.calcite.rex.RexOver;
+
+/** Transpose {@link LogicalProject} past into {@link LogicalSnapshot}. */
+public class ProjectSnapshotTransposeRule extends RelRule<ProjectSnapshotTransposeRule.Config> {
+
+ public static final RelOptRule INSTANCE =
+ ProjectSnapshotTransposeRule.Config.EMPTY.as(Config.class).withOperator().toRule();
+
+ public ProjectSnapshotTransposeRule(Config config) {
+ super(config);
+ }
+
+ @Override
+ public boolean matches(RelOptRuleCall call) {
+ LogicalProject project = call.rel(0);
+ return project.getProjects().stream().noneMatch(RexOver::containsOver);
Review Comment:
@Aitozi some comment should be here, I'll add it.
The reason we don't push a project which contains over into a snapshot is snapshot on window aggregate is unsupported for now.
--
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