-
Notifications
You must be signed in to change notification settings - Fork 14
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
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
BobdenOs
approved these changes
Nov 13, 2024
johannes-vogel
approved these changes
Nov 13, 2024
Merged
johannes-vogel
added a commit
that referenced
this pull request
Nov 14, 2024
🤖 I have created a release *beep* *boop* --- <details><summary>db-service: 1.15.0</summary> ## [1.15.0](db-service-v1.14.1...db-service-v1.15.0) (2024-11-14) ### Added * enable path expressions in infix filter after `exists` predicate ([#875](#875)) ([7e50359](7e50359)) ### Fixed * **`search`:** ignore invalid path expressions inside `@cds.search` ([#849](#849)) ([250edd5](250edd5)) * nested exists wrapped in xpr ([7e50359](7e50359)) </details> <details><summary>sqlite: 1.7.7</summary> ## [1.7.7](sqlite-v1.7.6...sqlite-v1.7.7) (2024-11-14) ### Fixed * boolean for sql_simple_queries ([#886](#886)) ([d8139fa](d8139fa)) </details> <details><summary>postgres: 1.10.4</summary> ## [1.10.4](postgres-v1.10.3...postgres-v1.10.4) (2024-11-14) ### Fixed * enable nulls first ([#893](#893)) ([6684436](6684436)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: Johannes Vogel <[email protected]>
This was referenced Jan 28, 2025
Closed
Closed
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theexists (<subquery>)
and then recursively transform it withcqn4sql
to get the proper joins.Usually, transforming the
exists <subquery>
is not necessary, because thewhere
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 sibilingexists
exists books[uppercase(genre.name) = 'FICTION']
-> detect path expressions anywhereSELECT from Authors:books[genre.name = 'FICTION']
→ What about scoped queries?fix: nested exists wrapped in xpr
reported in cap/cdsnode/issues/2194