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.
[x] exists books[genre.name = 'fiction' and exists author] -> mixed with sibiling exists
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