@Override public boolean matches(RelOptRuleCall call) { final Filter filterRel = call.rel(0); RexNode condition = filterRel.getCondition(); if (!HiveCalciteUtil.isDeterministic(condition)) { return false; } return super.matches(call); } }
/** * Creates a FilterAggregateTransposeRule. * * <p>If {@code filterFactory} is null, creates the same kind of filter as * matched in the rule. Similarly {@code aggregateFactory}.</p> */ public FilterAggregateTransposeRule( Class<? extends Filter> filterClass, RelBuilderFactory builderFactory, Class<? extends Aggregate> aggregateClass) { this( operand(filterClass, operand(aggregateClass, any())), builderFactory); }
/** Creates a MaterializedViewAggregateRule. */ protected MaterializedViewAggregateRule(RelOptRuleOperand operand, RelBuilderFactory relBuilderFactory, String description, boolean generateUnionRewriting, HepProgram unionRewritingPullProgram) { super(operand, relBuilderFactory, description, generateUnionRewriting, unionRewritingPullProgram, false); this.filterProjectTransposeRule = new FilterProjectTransposeRule( Filter.class, Project.class, true, true, relBuilderFactory); this.filterAggregateTransposeRule = new FilterAggregateTransposeRule( Filter.class, relBuilderFactory, Aggregate.class); this.aggregateProjectPullUpConstantsRule = new AggregateProjectPullUpConstantsRule( Aggregate.class, Filter.class, relBuilderFactory, "AggFilterPullUpConstants"); this.projectMergeRule = new ProjectMergeRule(true, relBuilderFactory); }
if (canPush(aggRel, rCols)) { pushedConditions.add( condition.accept(
/** * Creates a FilterAggregateTransposeRule. * * <p>If {@code filterFactory} is null, creates the same kind of filter as * matched in the rule. Similarly {@code aggregateFactory}.</p> */ public FilterAggregateTransposeRule( Class<? extends Filter> filterClass, RelBuilderFactory builderFactory, Class<? extends Aggregate> aggregateClass) { this( operand(filterClass, operand(aggregateClass, any())), builderFactory); }
/** Creates a MaterializedViewAggregateRule. */ protected MaterializedViewAggregateRule(RelOptRuleOperand operand, RelBuilderFactory relBuilderFactory, String description, boolean generateUnionRewriting, HepProgram unionRewritingPullProgram) { super(operand, relBuilderFactory, description, generateUnionRewriting, unionRewritingPullProgram, false); this.filterProjectTransposeRule = new FilterProjectTransposeRule( Filter.class, Project.class, true, true, relBuilderFactory); this.filterAggregateTransposeRule = new FilterAggregateTransposeRule( Filter.class, relBuilderFactory, Aggregate.class); this.aggregateProjectPullUpConstantsRule = new AggregateProjectPullUpConstantsRule( Aggregate.class, Filter.class, relBuilderFactory, "AggFilterPullUpConstants"); this.projectMergeRule = new ProjectMergeRule(true, relBuilderFactory); }
if (canPush(aggRel, rCols)) { pushedConditions.add( condition.accept(
HiveFilterJoinRule.JOIN, HiveFilterJoinRule.FILTER_ON_JOIN, new FilterAggregateTransposeRule(Filter.class, HiveFilter.DEFAULT_FILTER_FACTORY, Aggregate.class));
@Override public boolean matches(RelOptRuleCall call) { final Filter filterRel = call.rel(0); RexNode condition = filterRel.getCondition(); if (!HiveCalciteUtil.isDeterministic(condition)) { return false; } return super.matches(call); } }