fix bug about aggr ppd. (#1472)

This commit is contained in:
Han Fei
2016-07-19 14:20:12 +08:00
committed by GitHub
parent 35133ef397
commit c5c7ffdeb3
2 changed files with 6 additions and 0 deletions

View File

@ -84,6 +84,11 @@ func (s *testPlanSuite) TestPredicatePushDown(c *C) {
first string
best string
}{
{
sql: "select count(*) from t a, t b where a.a = b.a",
first: "Join{DataScan(t)->DataScan(t)}->Selection->Aggr->Projection",
best: "Join{DataScan(t)->DataScan(t)}->Aggr->Projection",
},
{
sql: "select a from (select a from t where d = 0) k where k.a = 5",
first: "DataScan(t)->Selection->Projection->Selection->Projection",

View File

@ -185,6 +185,7 @@ func (p *NewUnion) PredicatePushDown(predicates []expression.Expression) (ret []
// PredicatePushDown implements LogicalPlan PredicatePushDown interface.
func (p *Aggregation) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error) {
// TODO: implement aggregation push down.
p.GetChildByIndex(0).(LogicalPlan).PredicatePushDown(nil)
return predicates, p, nil
}