use of io.druid.sql.calcite.rule.DruidTableScanRule in project druid by druid-io.
the class Rules method baseRuleSet.
private static List<RelOptRule> baseRuleSet(final QueryMaker queryMaker, final DruidOperatorTable operatorTable) {
final PlannerConfig plannerConfig = queryMaker.getPlannerContext().getPlannerConfig();
final ImmutableList.Builder<RelOptRule> rules = ImmutableList.builder();
// Calcite rules.
rules.addAll(DEFAULT_RULES);
rules.addAll(MISCELLANEOUS_RULES);
rules.addAll(CONSTANT_REDUCTION_RULES);
rules.addAll(VOLCANO_ABSTRACT_RULES);
rules.addAll(RELOPTUTIL_ABSTRACT_RULES);
if (!plannerConfig.isUseApproximateCountDistinct()) {
// We'll need this to expand COUNT DISTINCTs.
// Avoid AggregateExpandDistinctAggregatesRule.INSTANCE; it uses grouping sets and we don't support those.
rules.add(AggregateExpandDistinctAggregatesRule.JOIN);
}
if (plannerConfig.isUseFallback()) {
rules.add(DruidRelToBindableRule.instance());
}
// Druid-specific rules.
rules.add(new DruidTableScanRule(queryMaker));
rules.add(new DruidFilterRule(operatorTable));
if (plannerConfig.getMaxSemiJoinRowsInMemory() > 0) {
rules.add(DruidSemiJoinRule.instance());
}
rules.addAll(SelectRules.rules(operatorTable));
rules.addAll(GroupByRules.rules(operatorTable));
return rules.build();
}
Aggregations