Skip to content

Commit 1dac8c5

Browse files
authored
Merge pull request #18419 from influxdata/feat/register-bare-agg-pushdown
feat(query): register bare aggregate
2 parents 830e4d4 + 1bf2ce1 commit 1dac8c5

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

cmd/influxd/launcher/query_test.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ from(bucket: "%s")
748748
}
749749
}
750750

751-
func TestLauncher_Query_PushDownWindowAggregate(t *testing.T) {
751+
func TestLauncher_Query_PushDownWindowAggregateAndBareAggregate(t *testing.T) {
752752
l := launcher.RunTestLauncherOrFail(t, ctx,
753753
"--feature-flags", "pushDownWindowAggregateCount=true")
754754
l.SetupOrFail(t)
@@ -809,6 +809,22 @@ from(bucket: v.bucket)
809809
,,0,5,f,m0,k0,1970-01-01T00:00:05Z
810810
,,0,5,f,m0,k0,1970-01-01T00:00:10Z
811811
,,0,5,f,m0,k0,1970-01-01T00:00:15Z
812+
`,
813+
},
814+
{
815+
name: "bare count",
816+
q: `
817+
from(bucket: v.bucket)
818+
|> range(start: 1970-01-01T00:00:00Z, stop: 1970-01-01T00:00:15Z)
819+
|> count()
820+
|> drop(columns: ["_start", "_stop"])
821+
`,
822+
res: `
823+
#group,false,false,false,true,true,true
824+
#datatype,string,long,long,string,string,string
825+
#default,_result,,,,,
826+
,result,table,_value,_field,_measurement,k
827+
,,0,15,f,m0,k0
812828
`,
813829
},
814830
} {

query/stdlib/influxdata/influxdb/rules.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ func init() {
2525
PushDownReadTagKeysRule{},
2626
PushDownReadTagValuesRule{},
2727
SortedPivotRule{},
28-
// For the following two rules to take effect the appropriate capabilities must be
29-
// added AND feature flags must be enabled.
3028
PushDownWindowAggregateRule{},
31-
// PushDownBareAggregateRule{},
29+
PushDownBareAggregateRule{},
3230
PushDownGroupAggregateRule{},
3331
)
3432
}
@@ -781,7 +779,7 @@ func (PushDownWindowAggregateRule) Rewrite(ctx context.Context, pn plan.Node) (p
781779
type PushDownBareAggregateRule struct{}
782780

783781
func (p PushDownBareAggregateRule) Name() string {
784-
return "PushDownWindowAggregateRule"
782+
return "PushDownBareAggregateRule"
785783
}
786784

787785
func (p PushDownBareAggregateRule) Pattern() plan.Pattern {

0 commit comments

Comments
 (0)