This commit is contained in:
Zoltan Haindrich 2023-08-22 09:57:56 +00:00
parent f392b86c4d
commit 2751198deb
3 changed files with 34 additions and 16 deletions

View File

@ -114,7 +114,7 @@ public class QueryContexts
public static final boolean DEFAULT_ENABLE_SQL_JOIN_LEFT_SCAN_DIRECT = false; public static final boolean DEFAULT_ENABLE_SQL_JOIN_LEFT_SCAN_DIRECT = false;
public static final boolean DEFAULT_USE_FILTER_CNF = false; public static final boolean DEFAULT_USE_FILTER_CNF = false;
public static final boolean DEFAULT_SECONDARY_PARTITION_PRUNING = true; public static final boolean DEFAULT_SECONDARY_PARTITION_PRUNING = true;
public static final boolean DEFAULT_ENABLE_DEBUG = false; public static final boolean DEFAULT_ENABLE_DEBUG = true;
public static final int DEFAULT_IN_SUB_QUERY_THRESHOLD = Integer.MAX_VALUE; public static final int DEFAULT_IN_SUB_QUERY_THRESHOLD = Integer.MAX_VALUE;
public static final boolean DEFAULT_ENABLE_TIME_BOUNDARY_PLANNING = false; public static final boolean DEFAULT_ENABLE_TIME_BOUNDARY_PLANNING = false;

View File

@ -133,7 +133,21 @@ public class CalciteRulesManager
CoreRules.FILTER_VALUES_MERGE, CoreRules.FILTER_VALUES_MERGE,
CoreRules.PROJECT_FILTER_VALUES_MERGE, CoreRules.PROJECT_FILTER_VALUES_MERGE,
CoreRules.PROJECT_VALUES_MERGE, CoreRules.PROJECT_VALUES_MERGE,
CoreRules.AGGREGATE_VALUES CoreRules.AGGREGATE_VALUES,
PruneEmptyRules.PROJECT_INSTANCE,
// PruneEmptyRules.UNION_INSTANCE,
// PruneEmptyRules.INTERSECT_INSTANCE,
// PruneEmptyRules.MINUS_INSTANCE,
// PruneEmptyRules.PROJECT_INSTANCE,
// PruneEmptyRules.FILTER_INSTANCE,
// PruneEmptyRules.SORT_INSTANCE,
// PruneEmptyRules.AGGREGATE_INSTANCE,
// PruneEmptyRules.JOIN_LEFT_INSTANCE,
// PruneEmptyRules.JOIN_RIGHT_INSTANCE,
// PruneEmptyRules.SORT_FETCH_ZERO_INSTANCE,
PruneEmptyRules.EMPTY_TABLE_INSTANCE
// CoreRules.FILTER_VALUES_MERGE,
// CoreRules.PROJECT_VALUES_MERGE
); );
/** /**
@ -233,7 +247,11 @@ public class CalciteRulesManager
boolean isDebug = plannerContext.queryContext().isDebug(); boolean isDebug = plannerContext.queryContext().isDebug();
return ImmutableList.of( return ImmutableList.of(
Programs.sequence(preProgram, Programs.ofRules(druidConventionRuleSet(plannerContext))), Programs.sequence(
preProgram,
// Programs.ofRules(logicalConventionRuleSet(plannerContext)),
Programs.ofRules(druidConventionRuleSet(plannerContext))
),
Programs.sequence(preProgram, Programs.ofRules(bindableConventionRuleSet(plannerContext))), Programs.sequence(preProgram, Programs.ofRules(bindableConventionRuleSet(plannerContext))),
Programs.sequence( Programs.sequence(
// currently, adding logging program after every stage for easier debugging // currently, adding logging program after every stage for easier debugging

View File

@ -49,17 +49,16 @@ public class DruidLogicalRules
{ {
return new ArrayList<>( return new ArrayList<>(
ImmutableList.of( ImmutableList.of(
new DruidValuesRule(
LogicalValues.class,
Convention.NONE,
DruidLogicalConvention.instance(),
DruidValuesRule.class.getSimpleName()
),
new DruidTableScanRule( new DruidTableScanRule(
RelOptRule.operand(LogicalTableScan.class, null, RelOptRule.any()), RelOptRule.operand(LogicalTableScan.class, null, RelOptRule.any()),
StringUtils.format("%s", DruidTableScanRule.class.getSimpleName()) StringUtils.format("%s", DruidTableScanRule.class.getSimpleName())
), ),
new DruidAggregateRule(
LogicalAggregate.class,
Convention.NONE,
DruidLogicalConvention.instance(),
DruidAggregateRule.class.getSimpleName(),
plannerContext
),
new DruidSortRule( new DruidSortRule(
LogicalSort.class, LogicalSort.class,
Convention.NONE, Convention.NONE,
@ -72,17 +71,18 @@ public class DruidLogicalRules
DruidLogicalConvention.instance(), DruidLogicalConvention.instance(),
DruidProjectRule.class.getSimpleName() DruidProjectRule.class.getSimpleName()
), ),
new DruidAggregateRule(
LogicalAggregate.class,
Convention.NONE,
DruidLogicalConvention.instance(),
DruidAggregateRule.class.getSimpleName(),
plannerContext
),
new DruidFilterRule( new DruidFilterRule(
LogicalFilter.class, LogicalFilter.class,
Convention.NONE, Convention.NONE,
DruidLogicalConvention.instance(), DruidLogicalConvention.instance(),
DruidFilterRule.class.getSimpleName() DruidFilterRule.class.getSimpleName()
),
new DruidValuesRule(
LogicalValues.class,
Convention.NONE,
DruidLogicalConvention.instance(),
DruidValuesRule.class.getSimpleName()
) )
) )
); );