TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
execute go test -check.f "testTransformationRuleSuite.TestWindowLogicalPlan" in path planner/cascades
2. What did you expect to see? (Required)
sql select a, max(a) over(), sum(a) over() from t should be built into only one LogicalPlan.
go test -check.f "testTransformationRuleSuite.TestWindowLogicalPlan"
false true
PASS: transformation_rules_test.go:528: testTransformationRuleSuite.TestWindowLogicalPlan 0.011s
OK: 1 passed
PASS
ok github.com/pingcap/tidb/planner/cascades 0.132s
3. What did you see instead (Required)
sql select a, max(a) over(), sum(a) over() from t is built into two different LogicalPlans.
go test -check.f "testTransformationRuleSuite.TestWindowLogicalPlan"
true true
PASS: transformation_rules_test.go:528: testTransformationRuleSuite.TestWindowLogicalPlan 0.011s
OK: 1 passed
PASS
ok github.com/pingcap/tidb/planner/cascades 0.132s
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
planner/cascades/transformation_rules_test.go
. The number of iterations can be greater than 100 :go test -check.f "testTransformationRuleSuite.TestWindowLogicalPlan"
in pathplanner/cascades
2. What did you expect to see? (Required)
sql
select a, max(a) over(), sum(a) over() from t
should be built into only one LogicalPlan.