Skip to content

Commit cca9464

Browse files
committed
Merge remote-tracking branch 'origin/morpheus'
Change-Id: I7a6ccfd79b1f33dffa7ef3dd2ee2afd10ab2b0ff
2 parents b1ba1c6 + 445b96c commit cca9464

3 files changed

Lines changed: 6 additions & 36 deletions

File tree

plan/group.go

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,13 @@ type InitialGroup struct {
2828
}
2929

3030
func NewInitialGroup(keys expression.Expressions, aggregates algebra.Aggregates,
31-
cost, cardinality float64, size int64, frCost float64, canSpill bool, groupAs string, groupAsFields []string) *InitialGroup {
31+
cost, cardinality float64, size int64, frCost float64, groupAs string, groupAsFields []string) *InitialGroup {
3232
rv := &InitialGroup{
3333
keys: keys,
3434
aggregates: aggregates,
3535
groupAs: groupAs,
3636
groupAsFields: groupAsFields,
3737
}
38-
if canSpill {
39-
rv.flags |= _CAN_SPILL
40-
}
4138
setOptEstimate(&rv.optEstimate, cost, cardinality, size, frCost)
4239
return rv
4340
}
@@ -66,10 +63,6 @@ func (this *InitialGroup) SetAggregates(aggregates algebra.Aggregates) {
6663
this.aggregates = aggregates
6764
}
6865

69-
func (this *InitialGroup) CanSpill() bool {
70-
return (this.flags & _CAN_SPILL) != 0
71-
}
72-
7366
func (this *InitialGroup) GroupAs() string {
7467
return this.groupAs
7568
}
@@ -179,15 +172,12 @@ type IntermediateGroup struct {
179172
}
180173

181174
func NewIntermediateGroup(keys expression.Expressions, aggregates algebra.Aggregates,
182-
cost, cardinality float64, size int64, frCost float64, canSpill bool, groupAs string) *IntermediateGroup {
175+
cost, cardinality float64, size int64, frCost float64, groupAs string) *IntermediateGroup {
183176
rv := &IntermediateGroup{
184177
keys: keys,
185178
aggregates: aggregates,
186179
groupAs: groupAs,
187180
}
188-
if canSpill {
189-
rv.flags |= _CAN_SPILL
190-
}
191181
setOptEstimate(&rv.optEstimate, cost, cardinality, size, frCost)
192182
return rv
193183
}
@@ -216,10 +206,6 @@ func (this *IntermediateGroup) SetAggregates(aggregates algebra.Aggregates) {
216206
this.aggregates = aggregates
217207
}
218208

219-
func (this *IntermediateGroup) CanSpill() bool {
220-
return (this.flags & _CAN_SPILL) != 0
221-
}
222-
223209
func (this *IntermediateGroup) GroupAs() string {
224210
return this.groupAs
225211
}
@@ -319,14 +305,11 @@ type FinalGroup struct {
319305
}
320306

321307
func NewFinalGroup(keys expression.Expressions, aggregates algebra.Aggregates,
322-
cost, cardinality float64, size int64, frCost float64, canSpill bool) *FinalGroup {
308+
cost, cardinality float64, size int64, frCost float64) *FinalGroup {
323309
rv := &FinalGroup{
324310
keys: keys,
325311
aggregates: aggregates,
326312
}
327-
if canSpill {
328-
rv.flags |= _CAN_SPILL
329-
}
330313
setOptEstimate(&rv.optEstimate, cost, cardinality, size, frCost)
331314
return rv
332315
}
@@ -355,10 +338,6 @@ func (this *FinalGroup) SetAggregates(aggregates algebra.Aggregates) {
355338
this.aggregates = aggregates
356339
}
357340

358-
func (this *FinalGroup) CanSpill() bool {
359-
return (this.flags & _CAN_SPILL) != 0
360-
}
361-
362341
func (this *FinalGroup) MarshalJSON() ([]byte, error) {
363342
return json.Marshal(this.MarshalBase(nil))
364343
}

planner/build_select_sub.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,12 +517,12 @@ func (this *builder) visitGroup(group *algebra.Group, aggs algebra.Aggregates) {
517517
}
518518

519519
this.addSubChildren(plan.NewInitialGroup(group.By(), aggv,
520-
costInitial, cardinalityInitial, size, costInitial, true, group.GroupAs(), allowedGroupAsFields))
520+
costInitial, cardinalityInitial, size, costInitial, group.GroupAs(), allowedGroupAsFields))
521521
this.addChildren(this.addSubchildrenParallel())
522522
this.addChildren(plan.NewIntermediateGroup(group.By(), aggv,
523-
costIntermediate, cardinalityIntermediate, size, costIntermediate, true, group.GroupAs()))
523+
costIntermediate, cardinalityIntermediate, size, costIntermediate, group.GroupAs()))
524524
this.addChildren(plan.NewFinalGroup(group.By(), aggv,
525-
costFinal, cardinalityFinal, size, costFinal, true))
525+
costFinal, cardinalityFinal, size, costFinal))
526526
}
527527

528528
this.addLetAndPredicate(group.Letting(), group.Having())

test/filestore/json/default/cases/case_by_id.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@
317317
"aggregates": [
318318
"count(*)"
319319
],
320-
"flags": 4,
321320
"group_keys": []
322321
}
323322
]
@@ -328,15 +327,13 @@
328327
"aggregates": [
329328
"count(*)"
330329
],
331-
"flags": 4,
332330
"group_keys": []
333331
},
334332
{
335333
"#operator": "FinalGroup",
336334
"aggregates": [
337335
"count(*)"
338336
],
339-
"flags": 4,
340337
"group_keys": []
341338
},
342339
{
@@ -402,7 +399,6 @@
402399
"count(*)",
403400
"min((`game`.`score`))"
404401
],
405-
"flags": 4,
406402
"group_keys": []
407403
}
408404
]
@@ -414,7 +410,6 @@
414410
"count(*)",
415411
"min((`game`.`score`))"
416412
],
417-
"flags": 4,
418413
"group_keys": []
419414
},
420415
{
@@ -423,7 +418,6 @@
423418
"count(*)",
424419
"min((`game`.`score`))"
425420
],
426-
"flags": 4,
427421
"group_keys": []
428422
},
429423
{
@@ -501,7 +495,6 @@
501495
"aggregates": [
502496
"count(*)"
503497
],
504-
"flags": 4,
505498
"group_keys": []
506499
}
507500
]
@@ -512,15 +505,13 @@
512505
"aggregates": [
513506
"count(*)"
514507
],
515-
"flags": 4,
516508
"group_keys": []
517509
},
518510
{
519511
"#operator": "FinalGroup",
520512
"aggregates": [
521513
"count(*)"
522514
],
523-
"flags": 4,
524515
"group_keys": []
525516
},
526517
{

0 commit comments

Comments
 (0)