Java Code Examples for org.apache.calcite.tools.RelBuilder#proto()

The following examples show how to use org.apache.calcite.tools.RelBuilder#proto() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PigRelBuilderStyleTest.java    From calcite with Apache License 2.0 6 votes vote down vote up
private RelOptPlanner getVolcanoPlanner(RelNode root) {
  final RelBuilderFactory builderFactory =
      RelBuilder.proto(PigRelFactories.ALL_PIG_REL_FACTORIES);
  final RelOptPlanner planner = root.getCluster().getPlanner(); // VolcanoPlanner
  for (RelOptRule r : PigRules.ALL_PIG_OPT_RULES) {
    planner.addRule(r);
  }
  planner.removeRule(FilterAggregateTransposeRule.INSTANCE);
  planner.removeRule(FilterJoinRule.FILTER_ON_JOIN);
  planner.addRule(
      new FilterAggregateTransposeRule(PigFilter.class, builderFactory,
          PigAggregate.class));
  planner.addRule(
      new FilterIntoJoinRule(true, builderFactory, TRUE_PREDICATE));
  planner.setRoot(root);
  return planner;
}
 
Example 2
Source File: FlinkFilterJoinRule.java    From flink with Apache License 2.0 5 votes vote down vote up
@Deprecated // to be removed before 2.0
public FlinkFilterIntoJoinRule(boolean smart,
		RelFactories.FilterFactory filterFactory,
		RelFactories.ProjectFactory projectFactory,
		Predicate predicate) {
	this(smart, RelBuilder.proto(filterFactory, projectFactory), predicate);
}
 
Example 3
Source File: FilterJoinRule.java    From Bats with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a FilterProjectTransposeRule with an explicit root operand and
 * factories.
 */
@Deprecated // to be removed before 2.0
protected FilterJoinRule(RelOptRuleOperand operand, String id,
    boolean smart, RelFactories.FilterFactory filterFactory,
    RelFactories.ProjectFactory projectFactory,
    Predicate predicate) {
  this(operand, id, smart, RelBuilder.proto(filterFactory, projectFactory),
      predicate);
}
 
Example 4
Source File: FilterJoinRule.java    From Bats with Apache License 2.0 5 votes vote down vote up
@Deprecated // to be removed before 2.0
public FilterIntoJoinRule(boolean smart,
    RelFactories.FilterFactory filterFactory,
    RelFactories.ProjectFactory projectFactory,
    Predicate predicate) {
  this(smart, RelBuilder.proto(filterFactory, projectFactory), predicate);
}
 
Example 5
Source File: AggregateUnionAggregateRule.java    From Bats with Apache License 2.0 5 votes vote down vote up
@Deprecated // to be removed before 2.0
public AggregateUnionAggregateRule(Class<? extends Aggregate> aggregateClass,
    RelFactories.AggregateFactory aggregateFactory,
    Class<? extends Union> unionClass,
    RelFactories.SetOpFactory setOpFactory) {
  this(aggregateClass, unionClass, RelNode.class, RelNode.class,
      RelBuilder.proto(aggregateFactory, setOpFactory),
      "AggregateUnionAggregateRule");
}
 
Example 6
Source File: FlinkAggregateJoinTransposeRule.java    From flink with Apache License 2.0 5 votes vote down vote up
@Deprecated // to be removed before 2.0
public FlinkAggregateJoinTransposeRule(Class<? extends Aggregate> aggregateClass,
		RelFactories.AggregateFactory aggregateFactory,
		Class<? extends Join> joinClass,
		RelFactories.JoinFactory joinFactory,
		RelFactories.ProjectFactory projectFactory) {
	this(aggregateClass, joinClass,
			RelBuilder.proto(aggregateFactory, joinFactory, projectFactory), false);
}
 
Example 7
Source File: FlinkFilterJoinRule.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a FlinkFilterJoinRule with an explicit root operand and
 * factories.
 */
@Deprecated // to be removed before 2.0
protected FlinkFilterJoinRule(RelOptRuleOperand operand, String id,
		boolean smart, RelFactories.FilterFactory filterFactory,
		RelFactories.ProjectFactory projectFactory) {
	this(operand, id, smart, RelBuilder.proto(filterFactory, projectFactory),
			TRUE_PREDICATE);
}
 
Example 8
Source File: AggregateJoinTransposeRule.java    From calcite with Apache License 2.0 5 votes vote down vote up
@Deprecated // to be removed before 2.0
public AggregateJoinTransposeRule(Class<? extends Aggregate> aggregateClass,
    RelFactories.AggregateFactory aggregateFactory,
    Class<? extends Join> joinClass,
    RelFactories.JoinFactory joinFactory,
    RelFactories.ProjectFactory projectFactory,
    boolean allowFunctions) {
  this(aggregateClass, joinClass,
      RelBuilder.proto(aggregateFactory, joinFactory, projectFactory),
      allowFunctions);
}
 
Example 9
Source File: FilterAggregateTransposeRule.java    From Bats with Apache License 2.0 5 votes vote down vote up
@Deprecated // to be removed before 2.0
public FilterAggregateTransposeRule(
    Class<? extends Filter> filterClass,
    RelFactories.FilterFactory filterFactory,
    Class<? extends Aggregate> aggregateClass) {
  this(filterClass, RelBuilder.proto(Contexts.of(filterFactory)),
      aggregateClass);
}
 
Example 10
Source File: JoinProjectTransposeRule.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Deprecated // to be removed before 2.0
public JoinProjectTransposeRule(RelOptRuleOperand operand,
    String description, ProjectFactory projectFactory) {
  this(operand, description, false,
      RelBuilder.proto(Contexts.of(projectFactory)));
}
 
Example 11
Source File: ProjectMergeRule.java    From Bats with Apache License 2.0 4 votes vote down vote up
@Deprecated // to be removed before 2.0
public ProjectMergeRule(boolean force, ProjectFactory projectFactory) {
  this(force, RelBuilder.proto(projectFactory));
}
 
Example 12
Source File: JoinPushThroughJoinRule.java    From Bats with Apache License 2.0 4 votes vote down vote up
@Deprecated // to be removed before 2.0
public JoinPushThroughJoinRule(String description, boolean right,
    Class<? extends Join> clazz, ProjectFactory projectFactory) {
  this(description, right, clazz, RelBuilder.proto(projectFactory));
}
 
Example 13
Source File: RelDecorrelator.java    From Bats with Apache License 2.0 4 votes vote down vote up
private RelBuilderFactory relBuilderFactory() {
    return RelBuilder.proto(relBuilder);
}
 
Example 14
Source File: FlinkFilterJoinRule.java    From flink with Apache License 2.0 4 votes vote down vote up
@Deprecated // to be removed before 2.0
public FlinkJoinConditionPushRule(RelFactories.FilterFactory filterFactory,
		RelFactories.ProjectFactory projectFactory, Predicate predicate) {
	this(RelBuilder.proto(filterFactory, projectFactory), predicate);
}
 
Example 15
Source File: LoptOptimizeJoinRule.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Deprecated // to be removed before 2.0
public LoptOptimizeJoinRule(RelFactories.JoinFactory joinFactory,
    RelFactories.ProjectFactory projectFactory,
    RelFactories.FilterFactory filterFactory) {
  this(RelBuilder.proto(joinFactory, projectFactory, filterFactory));
}
 
Example 16
Source File: JoinCommuteRule.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Deprecated // to be removed before 2.0
public JoinCommuteRule(Class<? extends Join> clazz,
    ProjectFactory projectFactory) {
  this(clazz, RelBuilder.proto(Contexts.of(projectFactory)), false);
}
 
Example 17
Source File: JoinCommuteRule.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Deprecated // to be removed before 2.0
public JoinCommuteRule(Class<? extends Join> clazz,
    ProjectFactory projectFactory, boolean swapOuter) {
  this(clazz, RelBuilder.proto(Contexts.of(projectFactory)), swapOuter);
}
 
Example 18
Source File: JoinPushExpressionsRule.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Deprecated // to be removed before 2.0
public JoinPushExpressionsRule(Class<? extends Join> clazz,
    RelFactories.ProjectFactory projectFactory) {
  this(clazz, RelBuilder.proto(projectFactory));
}
 
Example 19
Source File: ProjectMergeRule.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Deprecated // to be removed before 2.0
public ProjectMergeRule(boolean force, ProjectFactory projectFactory) {
  this(force, RelBuilder.proto(projectFactory));
}
 
Example 20
Source File: AggregateExpandDistinctAggregatesRule.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Deprecated // to be removed before 2.0
public AggregateExpandDistinctAggregatesRule(
    Class<? extends LogicalAggregate> clazz,
    RelFactories.JoinFactory joinFactory) {
  this(clazz, false, RelBuilder.proto(Contexts.of(joinFactory)));
}