Skip to content

Commit

Permalink
[FLINK-36848][table] Remove FlinkLimit0RemoveRule
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyongvs committed Dec 5, 2024
1 parent 266f3a5 commit 310bc71
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 75 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ object FlinkBatchRuleSets {
new CoerceInputsRule(classOf[LogicalMinus], false),
ConvertToNotInOrInRule.INSTANCE,
// optimize limit 0
FlinkLimit0RemoveRule.INSTANCE,
PruneEmptyRules.SORT_FETCH_ZERO_INSTANCE,
// fix: FLINK-28986 nested filter pattern causes unnest rule mismatch
CoreRules.FILTER_MERGE,
// unnest rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ object FlinkStreamRuleSets {
new CoerceInputsRule(classOf[LogicalMinus], false),
ConvertToNotInOrInRule.INSTANCE,
// optimize limit 0
FlinkLimit0RemoveRule.INSTANCE,
PruneEmptyRules.SORT_FETCH_ZERO_INSTANCE,
// fix: FLINK-28986 nested filter pattern causes unnest rule mismatch
CoreRules.FILTER_MERGE,
// unnest rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ import org.apache.flink.table.planner.plan.optimize.program.{BatchOptimizeContex
import org.apache.flink.table.planner.utils.TableTestBase

import org.apache.calcite.plan.hep.HepMatchOrder
import org.apache.calcite.rel.rules.PruneEmptyRules
import org.apache.calcite.tools.RuleSets
import org.junit.jupiter.api.{BeforeEach, Test}

/** Test for [[FlinkLimit0RemoveRule]]. */
class FlinkLimit0RemoveRuleTest extends TableTestBase {
/** Test for [[PruneEmptyRules.SORT_FETCH_ZERO_INSTANCE]]. */
class SortFetchZeroRuleTest extends TableTestBase {

private val util = batchTestUtil()

Expand All @@ -38,7 +39,8 @@ class FlinkLimit0RemoveRuleTest extends TableTestBase {
FlinkHepRuleSetProgramBuilder.newBuilder
.setHepRulesExecutionType(HEP_RULES_EXECUTION_TYPE.RULE_SEQUENCE)
.setHepMatchOrder(HepMatchOrder.BOTTOM_UP)
.add(RuleSets.ofList(FlinkSubQueryRemoveRule.FILTER, FlinkLimit0RemoveRule.INSTANCE))
.add(
RuleSets.ofList(FlinkSubQueryRemoveRule.FILTER, PruneEmptyRules.SORT_FETCH_ZERO_INSTANCE))
.build()
)
util.replaceBatchProgram(programs)
Expand Down

0 comments on commit 310bc71

Please sign in to comment.