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

feat: enable path expressions in infix filter after exists predicate #875

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

patricebender
Copy link
Member

@patricebender patricebender commented Oct 29, 2024

if a path expression is detected in a infix filter of an association which follows an exists predicate, we add the filter expression as a whole to the exists (<subquery>) and then recursively transform it with cqn4sql to get the proper joins.

Usually, transforming the exists <subquery> is not necessary, because the where clause is already well formed -> there is a mechanism to flag a path expression in this special case as such.

this is just a simple poc… more tests need to be added.

  • exists books[genre.name = 'fiction' and exists author] -> mixed with sibiling exists
  • exists books[uppercase(genre.name) = 'FICTION'] -> detect path expressions anywhere
  • SELECT from Authors:books[genre.name = 'FICTION'] → What about scoped queries?
    • we dont tacke them, yet

fix: nested exists wrapped in xpr

if a path expression is detected in a infix filter of an association which follows an
`exists` predicate, we add the filter expression as a whole to the
`exists (<subquery>)` and then recursively transform it with `cqn4sql`
to get the proper joins.

Usually, transforming the `exists <subquery>` is not necessary, because the
`where` clause is already well formed -> there is a mechanism to flag a
path expression in this special case as such.

this is just a simple poc… more tests need to be added.

- `exists books[genre.name = 'fiction' and exists author]` -> mixed with sibiling `exists`
- `exists books[uppercase(genre.name) = 'FICTION']` -> detect path expressions anywhere
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

Successfully merging this pull request may close these issues.

1 participant