The predicate of function if(predicate, arg1, arg2) in PPL should support complex expression.
The current implementation only supports TrueLiteral and FalseLiteral, just like the example given in doc. Query such as |eval test=if(pgs > 2, "yes", "no") will fail with "details": "Failed to parse query due to offending symbol [>] at:
This PR aims to support complex predicate expression, following cases will be supported:
[ ] All tests pass, including unit test, integration test and doctest
[ ] New functionality has been documented.
[ ] New functionality has javadoc added
[ ] New functionality has user manual doc added
[ ] Commits are signed per the DCO using --signoff
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Description
The predicate of function
if(predicate, arg1, arg2)
in PPL should support complex expression. The current implementation only supportsTrueLiteral
andFalseLiteral
, just like the example given in doc. Query such as|eval test=if(pgs > 2, "yes", "no")
will fail with"details": "Failed to parse query due to offending symbol [>] at:
This PR aims to support complex predicate expression, following cases will be supported:
Issues Resolved
Resolves https://github.com/opensearch-project/sql/issues/2600 and https://github.com/opensearch-project/sql/issues/2653
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Additional Context
https://github.com/opensearch-project/sql/pull/2756