Jira (PDB-4578) Order by and Group by don't work together

2 views
Skip to first unread message

Austin Blatt (JIRA)

unread,
Oct 31, 2019, 5:45:05 PM10/31/19
to puppe...@googlegroups.com
Austin Blatt created an issue
 
PuppetDB / New Feature PDB-4578
Order by and Group by don't work together
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2019/10/31 2:44 PM
Priority: Normal Normal
Reporter: Austin Blatt

This seems to be a result of aggregating functions, like count, creating "projections" that order by doesn't know about because they are not in the query maps defined in the query engine.

It is also explicitly disallowed in PQL, you can use only a group by or a paging operator, but not both.

In AST, the order by operator seems to nulify the entire extract statement where the group by is.

$ curl -X POST http://localhost:8080/pdb/query/v4 -H 'Content-Type:application/json' -d '{"query": [ "from", "events", [ "extract", [ ["function", "count"], "status" ], [ "group_by", "status" ] ] ]}'
[{"status":"success","count":1}] 

and when you add an order by get an error.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Claudia Petty (Jira)

unread,
Jun 21, 2023, 10:57:07 AM6/21/23
to puppe...@googlegroups.com
Claudia Petty updated an issue
Change By: Claudia Petty
Labels: new-feature
This message was sent by Atlassian Jira (v8.20.21#820021-sha1:38274c8)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages