You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
io.lettuce.core.RedisCommandExecutionException: Syntax error at offset 15 near onHandCases
at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:147)
at io.lettuce.core.internal.Exceptions.bubble(Exceptions.java:72)
at io.lettuce.core.internal.Futures.awaitOrCancel(Futures.java:250)
at io.lettuce.core.FutureSyncInvocationHandler.handleInvocation(FutureSyncInvocationHandler.java:75)
at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80)
at jdk.proxy2/jdk.proxy2.$Proxy2.ftSearch(Unknown Source)
at com.my-app.RedisQueryPoc.main(RedisQueryPoc.java:86)
Caused by: io.lettuce.core.RedisCommandExecutionException: Syntax error at offset 158 near onHandCases
at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:147)
at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:116)
at io.lettuce.core.protocol.AsyncCommand.completeResult(AsyncCommand.java:120)
at io.lettuce.core.protocol.AsyncCommand.complete(AsyncCommand.java:111)
at io.lettuce.core.protocol.CommandHandler.complete(CommandHandler.java:745)
at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:680)
at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:597)
Expected Query String
((@status:{A}) | (@onHandCases:[0 +inf])) --- with wrapping parenthesis at inner and outer
OR
(@status:{A}) | (@onHandCases:[0 +inf]) --- with wrapping parenthesis at inner condition
Note - 1's Outer because this will be further connected to series of and conditions later.
Redis Insights UI : I have verified that OR conditions works only with full wrapping parenthesis otherwise it fails with syntax error message Syntax error at offset 15 near onHandCases
Request / Ask
Let me know if I am not using the write constructs to chain or conditions.
If the construct seems appropriate, then it looks like a potential bug in the OR condition implementation, kindly address and fix. Also this seems like a pretty basic implementation expectation for or condition not sure why this is missed.
Version Details
lettucemod version : 4.2.1
lettucemod-query version : 4.2.1
The text was updated successfully, but these errors were encountered:
@banker / @sundb / @yossigo / @jruaux - gentle reminder to checkout this issue, and please let me know whether it's genuine issue or am I missing something in the implementation ?
Sample condition
Generated Query String
Failure stacktrace
Expected Query String
((@status:{A}) | (@onHandCases:[0 +inf]))
--- with wrapping parenthesis at inner and outerOR
(@status:{A}) | (@onHandCases:[0 +inf])
--- with wrapping parenthesis at inner conditionNote - 1's Outer because this will be further connected to series of
and
conditions later.Reference - Section
Mapping common SQL predicates to Redis Query Engine
in https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/query_syntax/SQL :
WHERE x='foo' OR y='bar'
REDIS :
(@x:foo)\|(@y:bar)
Self Assessments and Validation
In unit tests cases I could only find multi-valued or usage - https://github.com/redis/lettucemod/blob/master/core/lettucemod-query/src/test/java/com/redis/query/QueryBuilderTests.java#L108-L128
Redis Insights UI : I have verified that OR conditions works only with full wrapping parenthesis otherwise it fails with syntax error message
Syntax error at offset 15 near onHandCases
Request / Ask
or
conditions.or
condition not sure why this is missed.Version Details
lettucemod version : 4.2.1
lettucemod-query version : 4.2.1
The text was updated successfully, but these errors were encountered: