Bug 2248157

Summary: [rgw][s3select]: wrong output seen for query "select * from s3object[*].phonenumbers where _1.type is NOT null;"
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Hemanth Sai <hmaheswa>
Component: RGWAssignee: gal salomon <gsalomon>
Status: CLOSED ERRATA QA Contact: Hemanth Sai <hmaheswa>
Severity: high Docs Contact: Rivka Pollack <rpollack>
Priority: unspecified    
Version: 7.0CC: akraj, ceph-eng-bugs, cephqe-warriors, gsalomon, mbenjamin, tserlin
Target Milestone: ---Flags: gsalomon: needinfo-
Target Release: 7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ceph-18.2.0-127.el9cp Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-12-13 15:24:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2237662    

Description Hemanth Sai 2023-11-06 14:35:29 UTC
Description of problem:
wrong output seen for query "select * from s3object[*].phonenumbers where _1.type is NOT null;"
NOT or NULL in caps is giving wrong output


[cephuser@ceph-hmaheswa-reef-jlswrx-node5 ~]$ aws --endpoint-url http://10.0.207.204:80 s3api select-object-content --bucket bkt1 --key doc_example.json --expression-type 'SQL' --input-serialization '{"JSON": {"Type": "DOCUMENT"}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --expression "select * from s3object[*].phonenumbers where _1.type is not null;" /dev/stdout
phoneNumbers.type. : home1
phoneNumbers.number. : 734928_1
phoneNumbers.addr. : 11
#=== 0 ===#
phoneNumbers.type. : home2
phoneNumbers.number. : 734928_2
phoneNumbers.addr. : 22
#=== 1 ===#
phoneNumbers.type. : home3
phoneNumbers.number. : 734928_3
phoneNumbers.addr. : 33
#=== 2 ===#
phoneNumbers.type. : home4
phoneNumbers.number. : 734928_4
phoneNumbers.addr. : 44
#=== 3 ===#
phoneNumbers.type. : home5
phoneNumbers.number. : 734928_5
phoneNumbers.addr. : 55
#=== 4 ===#
phoneNumbers.type. : home6
phoneNumbers.number. : 734928_6
phoneNumbers.addr. : 66
#=== 5 ===#
phoneNumbers.type. : home7
phoneNumbers.number. : 734928_7
phoneNumbers.addr. : 77
#=== 6 ===#
phoneNumbers.type. : home8
phoneNumbers.number. : 734928_8
phoneNumbers.addr. : 88
#=== 7 ===#
phoneNumbers.type. : home9
phoneNumbers.number. : 734928_9
phoneNumbers.addr. : 99
#=== 8 ===#
phoneNumbers.type. : home10
phoneNumbers.number. : 734928_10
phoneNumbers.addr. : 100
#=== 9 ===#
[cephuser@ceph-hmaheswa-reef-jlswrx-node5 ~]$  
[cephuser@ceph-hmaheswa-reef-jlswrx-node5 ~]$ aws --endpoint-url http://10.0.207.204:80 s3api select-object-content --bucket bkt1 --key doc_example.json --expression-type 'SQL' --input-serialization '{"JSON": {"Type": "DOCUMENT"}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --expression "select * from s3object[*].phonenumbers where _1.type is NOT null;" /dev/stdout
[cephuser@ceph-hmaheswa-reef-jlswrx-node5 ~]$ 
[cephuser@ceph-hmaheswa-reef-jlswrx-node5 ~]$ aws --endpoint-url http://10.0.207.204:80 s3api select-object-content --bucket bkt1 --key doc_example.json --expression-type 'SQL' --input-serialization '{"JSON": {"Type": "DOCUMENT"}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --expression "select * from s3object[*].phonenumbers where _1.type is not NULL;" /dev/stdout
[cephuser@ceph-hmaheswa-reef-jlswrx-node5 ~]$


Version-Release number of selected component (if applicable):
ceph version 18.2.0-105.el9cp

How reproducible:
always

Steps to Reproduce:
1.deploy rhcs7.0 ceph cluster
2.upload an s3select object using aws-cli
3.execute the query "select * from s3object[*].phonenumbers where _1.type is not NULL;" and verify the results

Actual results:
NOT or NULL in caps is giving wrong output
but "not null" is giving correct output

Expected results:
should work correctly in caps as well: "NOT", "NULL"

Comment 1 gal salomon 2023-11-14 15:07:11 UTC
it is fixed in https://github.com/ceph/ceph/pull/54298

Comment 6 errata-xmlrpc 2023-12-13 15:24:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat Ceph Storage 7.0 Bug Fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:7780