Skip to content

Hazelcast 3.0.x - Failed to execute SqlPredicate with LIKE and OR keywords on the same field of the class #885

@Lumpusz

Description

@Lumpusz

Hi,

I was unable to execute the following sql as an SqlPredicate:

dimension0 like '%stg1' OR dimension0 like '%stg2'

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.LinkedList.entry(LinkedList.java:365)
at java.util.LinkedList.get(LinkedList.java:315)
at com.hazelcast.query.impl.OrResultSet.iterator(OrResultSet.java:48)
at com.hazelcast.map.operation.QueryOperation.run(QueryOperation.java:66)
at com.hazelcast.spi.impl.OperationServiceImpl.doRunOperation(OperationServiceImpl.java:222)
at com.hazelcast.spi.impl.OperationServiceImpl.runOperation(OperationServiceImpl.java:137)
at com.hazelcast.spi.impl.InvocationImpl.doInvoke(InvocationImpl.java:172)
at com.hazelcast.spi.impl.InvocationImpl.invoke(InvocationImpl.java:106)
at com.hazelcast.map.client.AbstractMapQueryRequest.invoke(AbstractMapQueryRequest.java:69)
at com.hazelcast.client.InvocationClientRequest.process(InvocationClientRequest.java:29)
at com.hazelcast.client.ClientEngineImpl$ClientPacketProcessor.run(ClientEngineImpl.java:359)
at com.hazelcast.util.executor.ManagedExecutorService$Worker.run(ManagedExecutorService.java:148)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
at com.hazelcast.util.executor.PoolExecutorThreadFactory$ManagedThread.run(PoolExecutorThreadFactory.java:59)
at ------ End remote and begin local stack-trace ------.(Unknown Source)
at com.hazelcast.client.util.ErrorHandler.returnResultOrThrowException(ErrorHandler.java:33)
at com.hazelcast.client.spi.impl.ClientClusterServiceImpl._sendAndReceive(ClientClusterServiceImpl.java:160)
at com.hazelcast.client.spi.impl.ClientClusterServiceImpl.sendAndReceive(ClientClusterServiceImpl.java:120)
at com.hazelcast.client.spi.impl.ClientInvocationServiceImpl.invokeOnRandomTarget(ClientInvocationServiceImpl.java:37)
at com.hazelcast.client.proxy.ClientMapProxy.invoke(ClientMapProxy.java:502)
at com.hazelcast.client.proxy.ClientMapProxy.entrySet(ClientMapProxy.java:383)

By adding one more condition I got StackOverflowError:

dimension0 like '%stg1' OR dimension0 like '%stg2' OR dimension0 like '%stg3'

java.lang.StackOverflowError
at com.hazelcast.query.Predicates$OrPredicate.filter(Predicates.java:374)
at com.hazelcast.query.Predicates$OrPredicate.filter(Predicates.java:379)
at com.hazelcast.query.Predicates$OrPredicate.filter(Predicates.java:379)
….
at com.hazelcast.query.Predicates$OrPredicate.filter(Predicates.java:379)
at ------ End remote and begin local stack-trace ------.(Unknown Source)
at com.hazelcast.client.util.ErrorHandler.returnResultOrThrowException(ErrorHandler.java:33)
at com.hazelcast.client.spi.impl.ClientClusterServiceImpl._sendAndReceive(ClientClusterServiceImpl.java:160)
at com.hazelcast.client.spi.impl.ClientClusterServiceImpl.sendAndReceive(ClientClusterServiceImpl.java:120)
at com.hazelcast.client.spi.impl.ClientInvocationServiceImpl.invokeOnRandomTarget(ClientInvocationServiceImpl.java:37)
at com.hazelcast.client.proxy.ClientMapProxy.invoke(ClientMapProxy.java:502)
at com.hazelcast.client.proxy.ClientMapProxy.entrySet(ClientMapProxy.java:383)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions