Description
Currently, SQL-2 supports multiple paths restrictions combined with "or", and it supports "union". XPath doesn't support either. It would be good if this is supported, specially the "multiple paths" part.
I think it makes sense to convert this to a SQL-2 "union" in all cases, even if it's just multiple paths.
It doesn't need to be a "generic" solution, so that "|" doesn't need to be supported at every place (for example in the condition, or in the "order by"). But it would be nice if multiple independent queries, with one order by, could be supported.
Implementation note: what makes this a bit complicated is support for "order by".
For example:
/jcr:root/(content|lib)/element(*, nt:base) order by @title select [jcr:path], [jcr:score], * from [nt:base] as a where ischildnode(a, '/content') /* xpath: /jcr:root/content/element(*, nt:base) order by @title */ union select [jcr:path], [jcr:score], * from [nt:base] as a where ischildnode(a, '/lib') /* xpath: /jcr:root/lib/element(*, nt:base) order by @title */ order by [title]
Attachments
Issue Links
- is related to
-
OAK-6116 SQL generated from xpath with 3 or more ORed paths along with order by clause throws parseException
- Closed
-
OAK-5085 XPath: union bugfix
- Closed
-
OAK-5413 XPath: "union" combined with "or" is not converted correctly
- Closed
- relates to
-
OAK-5064 XPath: chained conditions and union bugfix
- Closed