@@ -99,62 +99,12 @@ ORDER BY b, a`,
9999 },
100100 },
101101 {
102- // https://github.com/googleapis/google-cloud-go/blob/main/bigtable/integration_test.go#L4831C36-L4831C101
103- query : "SELECT _key, count(fam1['col1']) as count FROM `t1` GROUP BY _key" ,
104- expectCfg : & CMVConfig {
105- SourceTable : "t1" ,
106- IncludeFamilies : []string {"fam1" },
107- },
108- },
109- {
110- // https://docs.cloud.google.com/bigtable/docs/continuous-materialized-view-queries#aggregated-data
111- query : `SELECT
112- fam["baz"] AS baz,
113- SUM(fam["foo"]) AS sum_foo,
114- SUM(fam["bar"]) AS sum_bar
115- FROM
116- ` + "`TABLE`" + `
117- GROUP BY
118- baz` ,
119- expectCfg : & CMVConfig {
120- SourceTable : "TABLE" ,
121- },
122- },
123- {
124- // https://docs.cloud.google.com/bigtable/docs/continuous-materialized-view-queries#select-statement
125- query : `SELECT
126- myfamily["node"] AS node,
127- myfamily["type"] AS type,
128- COUNT(clicks) AS clicks_per_key
129- FROM
130- ` + "`mytable`" + `
131- GROUP BY
132- node,
133- type` ,
134- expectCfg : & CMVConfig {
135- SourceTable : "mytable" ,
136- },
102+ // GROUP BY (aggregation) queries are not supported — the emulator only handles
103+ // ORDER BY (key re-mapping) CMVs. Aggregation requires maintaining running state
104+ // across writes, which is a fundamentally different execution model.
105+ query : "SELECT _key, count(fam1['col1']) as count FROM `t1` GROUP BY _key" ,
106+ expectErr : "GROUP BY" ,
137107 },
138- {
139- // https://docs.cloud.google.com/bigtable/docs/continuous-materialized-view-queries#timestamps
140- query : `SELECT
141- _key,
142- TIMESTAMP_TRUNC(_timestamp, DAY) AS _timestamp,
143- SUM(sum_family["sum_column"]) AS sum_column,
144- SUM(sum_family["foo"]) AS second_sum_column
145- FROM
146- UNPACK(
147- SELECT
148- *
149- FROM
150- my_table(with_history => TRUE))
151- GROUP BY
152- 1,
153- 2` ,
154- expectCfg : & CMVConfig {
155- SourceTable : "my_table" ,
156- },
157- }
158108 }
159109
160110 for i , tc := range tests {
0 commit comments