Jira (PDB-5258) Investigate where does the `null?` operator work

10 views
Skip to first unread message

Bogdan Irimie (Jira)

unread,
Sep 8, 2021, 4:20:03 AM9/8/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
 
PuppetDB / Task PDB-5258
Investigate where does the `null?` operator work
Change By: Bogdan Irimie
Summary: Investigate where does the `null?` operator works work
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Bogdan Irimie (Jira)

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

Oana Tanasoiu (Jira)

unread,
Sep 8, 2021, 5:31:02 AM9/8/21
to puppe...@googlegroups.com

Oana Tanasoiu (Jira)

unread,
Sep 9, 2021, 4:58:03 PM9/9/21
to puppe...@googlegroups.com
Oana Tanasoiu commented on Task PDB-5258
 
Re: Investigate where does the `null?` operator work

1. 

["=", ["fact", "id"], <value>]

works on the nodes endpoint because the array `["fact", "id"]` gets parsed along the way and when it's translated into sql plan it's the string `fact.id`.

2. 3. 4.

["null?", ["fact", "id"], false]

 doesn't work on any endpoint, I tried on: catalogs, edges, environments, event-counts, events, fact-names, facts, fact-contents, fact-paths, nodes, producers, query, reports, resources

On all endpoints the error is:

Value does not match schema: (not (map? nil))

 This error message is seen after applying the fix in  https://tickets.puppetlabs.com/browse/PDB-4305?focusedCommentId=821546&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-821546 .

---------------------------------------------------------------------------------------------------------

The `null?` operator works fine on the queryable fields of the endpoints, so the query 

["null?", certname, false]

on nodes (`certname` is a direct field of the nodes endpoint) works as expected.

If I force the field on which the `null?` operator is applied to be an array

["null?", [certname], false]

the query result is the same error message: 

Value does not match schema: (not (map? nil))

Oana Tanasoiu (Jira)

unread,
Sep 13, 2021, 11:14:03 AM9/13/21
to puppe...@googlegroups.com
Oana Tanasoiu commented on Task PDB-5258

Did 

["null?", ["fact", "id"], false]

 ever worked?

Oana Tanasoiu (Jira)

unread,
Sep 21, 2021, 1:00:04 PM9/21/21
to puppe...@googlegroups.com
Oana Tanasoiu commented on Task PDB-5258

I tested with 5.1.6, 5.1.0, 4.1.4 (this version doesn't have the inventory endpoint implemented) and the query doesn't work.

Reply all
Reply to author
Forward
0 new messages