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

Support for Array Operators #100

Open
aemonm opened this issue Jul 26, 2023 · 1 comment
Open

Support for Array Operators #100

aemonm opened this issue Jul 26, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@aemonm
Copy link

aemonm commented Jul 26, 2023

It would be nice to have array operator support as outlined here.
Array Operators: (http://www.opengis.net/spec/cql2/1.0/conf/array-operators) defines array operators (A_EQUALS, A_CONTAINS, A_CONTAINED_BY, and A_OVERLAPS)

We are specifically hoping to support an intersection check equivalent to something like:
SQL SELECT * FROM some_table t WHERE someClientArray && t.db_array // check to see if there's at least one value in common

@vincentsarago vincentsarago added the enhancement New feature or request label Jul 26, 2023
@jonaraphael
Copy link

jonaraphael commented Dec 6, 2023

@vincentsarago ,
I've been working with David Bitner to try to figure out another way to process arrays through the CQL-2 JSON filter. Our desired line of SQL is this:
WHERE 4485 = ANY(source_type_1_ids)
(4485 is a user-provided bigint, and source_type_1_ids is a bigint[] column)

He suggested two ways to do this:

  1. {'op': 'any', 'args': [{'property': 'source_type_1_ids'}]}
    returns Unable to parse expression node {'op': 'any', 'args': [{'property': 'source_type_1_ids'}]}

  2. {"op":"in", "args":[4485,{"property": "source_type_1_ids"}]}
    returns {"detail":"'Attribute' object is not iterable"}

Can you tell me what the correct syntax to execute this functionality is?
If this SQL functionality is not currently supported by TiPG, do you have a sense of level of effort / time it would take to support it?

Thank you!

(Also, sorry David, if this is the wrong place to post this question!)

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

No branches or pull requests

4 participants