Skip to content

Commit

Permalink
fix: failing e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Harshit Gangal <[email protected]>
  • Loading branch information
harshit-gangal committed Jun 12, 2024
1 parent 2a66e01 commit 5923fe5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go/test/endtoend/vtgate/queries/subquery/subquery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func TestSubqueries(t *testing.T) {
// This method tests many types of subqueries. The queries should move to a vitess-tester test file once we have a way to run them.
// The commented out queries are failing because of wrong types being returned.
// The tests are commented out until the issue is fixed.
// utils.SkipIfBinaryIsBelowVersion(t, 21, "vtgate")
utils.SkipIfBinaryIsBelowVersion(t, 19, "vtgate")
mcmp, closer := start(t)
defer closer()
queries := []string{
Expand Down
6 changes: 2 additions & 4 deletions go/vt/vtgate/planbuilder/operators/aggregation_pushing.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ func pushAggregationThroughSubquery(
rootAggr *Aggregator,
src *SubQueryContainer,
) (Operator, *ApplyResult) {
pushedAggr := rootAggr.Clone([]Operator{src.Outer}).(*Aggregator)
pushedAggr.Original = false
pushedAggr.Pushed = false
pushedAggr := rootAggr.SplitAggregatorBelowOperators(ctx, []Operator{src.Outer})
for _, subQuery := range src.Inner {
lhsCols := subQuery.OuterExpressionsNeeded(ctx, src.Outer)
for _, colName := range lhsCols {
Expand Down Expand Up @@ -152,7 +150,7 @@ func pushAggregationThroughRoute(
route *Route,
) (Operator, *ApplyResult) {
// Create a new aggregator to be placed below the route.
aggrBelowRoute := aggregator.SplitAggregatorBelowRoute(ctx, route.Inputs())
aggrBelowRoute := aggregator.SplitAggregatorBelowOperators(ctx, route.Inputs())
aggrBelowRoute.Aggregations = nil

pushAggregations(ctx, aggregator, aggrBelowRoute)
Expand Down
4 changes: 2 additions & 2 deletions go/vt/vtgate/planbuilder/operators/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,10 @@ func (a *Aggregator) internalAddColumn(ctx *plancontext.PlanningContext, aliased
return offset
}

// SplitAggregatorBelowRoute returns the aggregator that will live under the Route.
// SplitAggregatorBelowOperators returns the aggregator that will live under the Route.
// This is used when we are splitting the aggregation so one part is done
// at the mysql level and one part at the vtgate level
func (a *Aggregator) SplitAggregatorBelowRoute(ctx *plancontext.PlanningContext, input []Operator) *Aggregator {
func (a *Aggregator) SplitAggregatorBelowOperators(ctx *plancontext.PlanningContext, input []Operator) *Aggregator {
newOp := a.Clone(input).(*Aggregator)
newOp.Pushed = false
newOp.Original = false
Expand Down

0 comments on commit 5923fe5

Please sign in to comment.