kasakrisz commented on a change in pull request #1349:
URL: https://github.com/apache/hive/pull/1349#discussion_r464309156
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterJoinRule.java
##########
@@ -52,14 +55,34 @@ protected HiveFilterJoinRule(RelOptRuleOperand operand,
String id, boolean smart
super(operand, id, smart, relBuilderFactory, TRUE_PREDICATE);
}
+ /**
+ * Rule that tries to push filter expressions into a join condition and into
+ * the inputs of the join, iff the join is a column appending
+ * non-filtering join.
+ */
+ public static class HiveFilterNonFilteringJoinMergeRule extends
HiveFilterJoinMergeRule {
+
+ @Override
+ public boolean matches(RelOptRuleCall call) {
+ Join join = call.rel(1);
+ RewritablePKFKJoinInfo joinInfo = HiveRelOptUtil.isRewritablePKFKJoin(
+ join, true, call.getMetadataQuery());
+ if (!joinInfo.rewritable) {
+ return false;
+ }
+ return super.matches(call);
+ }
+
+ }
+
/**
* Rule that tries to push filter expressions into a join condition and into
* the inputs of the join.
*/
public static class HiveFilterJoinMergeRule extends HiveFilterJoinRule {
public HiveFilterJoinMergeRule() {
- super(RelOptRule.operand(Filter.class, RelOptRule.operand(Join.class,
RelOptRule.any())),
- "HiveFilterJoinRule:filter", true, HiveRelFactories.HIVE_BUILDER);
+ super(operand(Filter.class, operand(Join.class, any())),
+ null, true, HiveRelFactories.HIVE_BUILDER);
Review comment:
nit: you can expose the `id` parameter to the constructor of
`HiveFilterJoinMergeRule `
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]