Skip to content

Commit

Permalink
[FLINK-xx][table] Add more Calcite PruneEmptyRules
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyongvs committed Dec 20, 2024
1 parent 1523f2c commit e7ad3aa
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,16 @@ object FlinkBatchRuleSets {

/** RuleSet to prune empty results rules */
val PRUNE_EMPTY_RULES: RuleSet = RuleSets.ofList(
PruneEmptyRules.AGGREGATE_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.PROJECT_INSTANCE,
PruneEmptyRules.SORT_INSTANCE,
PruneEmptyRules.UNION_INSTANCE
PruneEmptyRules.EMPTY_TABLE_INSTANCE
)

/** RuleSet about project */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,16 @@ object FlinkStreamRuleSets {

/** RuleSet to prune empty results rules */
val PRUNE_EMPTY_RULES: RuleSet = RuleSets.ofList(
PruneEmptyRules.AGGREGATE_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.PROJECT_INSTANCE,
PruneEmptyRules.SORT_INSTANCE,
PruneEmptyRules.UNION_INSTANCE
PruneEmptyRules.EMPTY_TABLE_INSTANCE
)

/** RuleSet about project */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,8 @@ LogicalMinus(all=[false])
</Resource>
<Resource name="optimized exec plan">
<![CDATA[
HashAggregate(isMerge=[true], groupBy=[c], select=[c])
+- Exchange(distribution=[hash[c]])
+- LocalHashAggregate(groupBy=[c], select=[c])
+- Calc(select=[c])
+- LegacyTableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
Calc(select=[c])
+- LegacyTableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
]]>
</Resource>
</TestCase>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,8 @@ LogicalMinus(all=[false])
</Resource>
<Resource name="optimized exec plan">
<![CDATA[
GroupAggregate(groupBy=[c], select=[c])
+- Exchange(distribution=[hash[c]])
+- Calc(select=[c])
+- LegacyTableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
Calc(select=[c])
+- LegacyTableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
]]>
</Resource>
</TestCase>
Expand Down

0 comments on commit e7ad3aa

Please sign in to comment.