Jira (PDB-5262) Grouping by facts that contain "/" generates invalid SQL

9 views
Skip to first unread message

Sebastian Miclea (Jira)

unread,
Sep 14, 2021, 10:35:02 AM9/14/21
to puppe...@googlegroups.com
Sebastian Miclea created an issue
 
PuppetDB / Bug PDB-5262
Grouping by facts that contain "/" generates invalid SQL
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/09/14 7:34 AM
Priority: Normal Normal
Reporter: Sebastian Miclea

Example query:

["extract",[["function", "count"], "facts.partitions.\/.size"], ["group_by", "facts.partitions.\/.size"]]

Result:

Unterminated identifier started at position 699 in SQL WITH inactive_nodes AS (SELECT certname FROM certnames WHERE (deactivated IS NOT NULL AND deactivated > '2021-08-31T14:29:44.254Z') OR (expired IS NOT NULL and expired > '2021-08-31T14:29:44.254Z')), not_active_nodes AS (SELECT certname FROM certnames WHERE (deactivated IS NOT NULL OR expired IS NOT NULL)) SELECT (fs.stable||fs.volatile)->'partitions'->'/'->'size' AS "facts.partitions./.size", count(*) count FROM factsets fs LEFT JOIN environments ON fs.environment_id = environments.id LEFT JOIN certnames ON fs.certname = certnames.certname WHERE NOT ((certnames.certname) in (SELECT certname FROM ( SELECT not_active_nodes.certname AS "certname" FROM not_active_nodes ) sub)) GROUP BY .size". Expected " char

Endpoint:http://localhost:8080/pdb/query/v4/inventory

GROUP BY statement contains only what is after "/".

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Bogdan Irimie (Jira)

unread,
Sep 22, 2021, 4:00:03 AM9/22/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Sep 22, 2021, 4:01:02 AM9/22/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Sep 22, 2021, 4:02:03 AM9/22/21
to puppe...@googlegroups.com

Sebastian Miclea (Jira)

unread,
Sep 28, 2021, 2:55:03 AM9/28/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages