-
Feature Request
-
Resolution: Done
-
Major
-
4.0.0.Alpha2
-
None
Standard JCR-SQL2 only allows `CAST( ``value`` AS ``type`` )` on the right-hand side of a constraint. This is limiting, especially when the property value may contain a value that is convertible to another type and the constraint should be applied using that other type.
For example, consider a node type with a property definition for `propertyY` that defines the type as a STRING. Even if some of those values contained string-representations of DOUBLE values, the following query could not be performed:
SELECT * FROM [nodex] as x where x.propertyY <= 20.50
It would be nice to be able to do this:
SELECT * FROM [nodex] as x where CAST(x.propertyY AS DOUBLE) <= 20.50
Doing this will require having a `DynamicOperand` subtype for the `CAST` operation, though the value in the cast probably only needs to be a `PropertyValue`. Specifically, something like this:
DynamicOperand ::= PropertyValue | ReferenceValue | Length | NodeName | NodeLocalName | NodePath | NodeDepth | CastPropertyValue | FullTextSearchScore | LowerCase | UpperCase | Arithmetic | '(' DynamicOperand ')' CastPropertyValue ::= 'CAST(' PropertyValue ' AS ' PropertyType ')'
where `PropertyValue` and `PropertyType` are already defined in the grammar.
- is blocked by
-
MODE-2018 Query engine should work with no indexes and with defined indexes
- Resolved