@@ -249,7 +249,7 @@ impl<'a> Analysis<'a> {
249249
250250 if let Some ( group_by) = & query. group_by {
251251 let node = self . arena . exprs . get ( group_by. expr ) ;
252- if !matches ! ( node. value, Value :: Access ( _) ) {
252+ if !matches ! ( node. value, Value :: Access ( _) | Value :: Id ( _ ) ) {
253253 return Err ( AnalysisError :: ExpectFieldLiteral (
254254 node. attrs . pos . line ,
255255 node. attrs . pos . col ,
@@ -258,7 +258,7 @@ impl<'a> Analysis<'a> {
258258
259259 self . analyze_expr ( & mut ctx, group_by. expr , Type :: Unspecified ) ?;
260260
261- if let Some ( expr) = group_by. predicate . as_ref ( ) . copied ( ) {
261+ if let Some ( expr) = group_by. predicate {
262262 ctx. allow_agg_func = true ;
263263 ctx. use_agg_funcs = true ;
264264
@@ -282,7 +282,7 @@ impl<'a> Analysis<'a> {
282282 if let Some ( order_by) = & query. order_by {
283283 self . analyze_expr ( & mut ctx, order_by. expr , Type :: Unspecified ) ?;
284284 let node = self . arena . exprs . get ( order_by. expr ) ;
285- if query. group_by . is_none ( ) && !matches ! ( node. value, Value :: Access ( _) ) {
285+ if query. group_by . is_none ( ) && !matches ! ( node. value, Value :: Access ( _) | Value :: Id ( _ ) ) {
286286 return Err ( AnalysisError :: ExpectFieldLiteral (
287287 node. attrs . pos . line ,
288288 node. attrs . pos . col ,
0 commit comments