Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CQL2 Case-insensitive Comparison upper/lower #656

Closed
philvarner opened this issue Dec 2, 2021 · 2 comments
Closed

CQL2 Case-insensitive Comparison upper/lower #656

philvarner opened this issue Dec 2, 2021 · 2 comments

Comments

@philvarner
Copy link
Contributor

In CQL2 Text, the Case-insensitive Comparison tokens UPPER and LOWER look like they're just user-defined functions. In CQL2 JSON, they're special objects with the format

 { 
   "lower" : { "property": "foo" }
 }

or

 { 
   "upper" : { "property": "foo" }
 }

This requires a special case in the BNF and schema, when they could just be a pre-defined function with specific semantics for taking a string-valued expression and returning a string. I bring this up because I made the mistake of writing up some examples that treated them as functions, and someone challenged me on that thinking they were operators, and I had to go look in the openapi spec to see that they were neither, and instead their own thing.

If they were functions, they'd be written in JSON as:

 { 
        "function" : "lower",
        "args": [ { "property": "foo" } ]
 }
{ 
        "function": "upper", 
        "args": [ { "property": "foo" } ]
 }

Which seems easier to me than having a separate special format for them.

@pvretano
Copy link
Contributor

pvretano commented Dec 2, 2021

@philvarner already aware of the incongruity. Will be handled as part of pr #641.

@philvarner
Copy link
Contributor Author

Great, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants