meridor / perspective-backend

Scalable multi-cloud management API and shell
Apache License 2.0
16 stars 6 forks source link

UnsupportedOperationException in SQL with IN clause #174

Closed vania-pooh closed 8 years ago

vania-pooh commented 8 years ago
2016-10-18 13:54:58,378 [             XNIO-1 I/O-1] INFO  org.meridor.perspective.rest.resources.InstancesResource     - Processing query #5 with sql = "select * from instance_metadata where instance_id in (:instance_id:)" and parameters = [org.meridor.perspective.sql.Parameter@3329801[index=<null>, name=instance_id, value=85aeac9f-ca54-3bf1-8ac8-60a8b022f4e2]]
2016-10-18 13:54:58,397 [             XNIO-1 I/O-1] DEBUG org.meridor.perspective.sql.impl.QueryProcessorImpl          - Marking query as having evaluation error
java.sql.SQLException: java.lang.UnsupportedOperationException
    at org.meridor.perspective.sql.impl.QueryPlannerImpl.processSelectQuery(QueryPlannerImpl.java:120)
    at org.meridor.perspective.sql.impl.QueryPlannerImpl.plan(QueryPlannerImpl.java:66)
    at org.meridor.perspective.sql.impl.QueryProcessorImpl.parseSQL(QueryProcessorImpl.java:94)
    at org.meridor.perspective.sql.impl.QueryProcessorImpl.processQuery(QueryProcessorImpl.java:62)
    at org.meridor.perspective.sql.impl.QueryProcessorImpl.access$000(QueryProcessorImpl.java:27)
    at org.meridor.perspective.sql.impl.QueryProcessorImpl$1.load(QueryProcessorImpl.java:41)
    at org.meridor.perspective.sql.impl.QueryProcessorImpl$1.load(QueryProcessorImpl.java:39)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3542)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2323)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2286)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2201)
    at com.google.common.cache.LocalCache.get(LocalCache.java:3953)
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3957)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4875)
    at org.meridor.perspective.sql.impl.QueryProcessorImpl.process(QueryProcessorImpl.java:50)
    at org.meridor.perspective.rest.resources.QueryResource.lambda$query$40(QueryResource.java:50)
    at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
    at org.meridor.perspective.rest.resources.QueryResource.query(QueryResource.java:51)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.meridor.perspective.rest.handler.impl.HandlerProviderImpl.lambda$null$63(HandlerProviderImpl.java:107)
    at org.meridor.perspective.rest.handler.impl.HandlerProviderImpl.lambda$getBody$67(HandlerProviderImpl.java:229)
    at io.undertow.io.AsyncReceiverImpl.receiveFullBytes(AsyncReceiverImpl.java:399)
    at io.undertow.io.AsyncReceiverImpl.receiveFullBytes(AsyncReceiverImpl.java:481)
    at org.meridor.perspective.rest.handler.impl.HandlerProviderImpl.getBody(HandlerProviderImpl.java:222)
    at org.meridor.perspective.rest.handler.impl.HandlerProviderImpl.lambda$getHandler$64(HandlerProviderImpl.java:102)
    at io.undertow.server.RoutingHandler.handleRequest(RoutingHandler.java:93)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
    at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:243)
    at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:134)
    at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:148)
    at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:92)
    at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:51)
    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
    at org.xnio.ChannelListeners$10.handleEvent(ChannelListeners.java:291)
    at org.xnio.ChannelListeners$10.handleEvent(ChannelListeners.java:286)
    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
    at org.xnio.nio.QueuedNioTcpServer$1.run(QueuedNioTcpServer.java:128)
    at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:580)
    at org.xnio.nio.WorkerThread.run(WorkerThread.java:464)
Caused by: java.lang.UnsupportedOperationException
    at java.util.Collections$1.remove(Collections.java:4684)
    at java.util.AbstractMap.remove(AbstractMap.java:254)
    at org.meridor.perspective.sql.impl.QueryPlannerImpl$1.<init>(QueryPlannerImpl.java:449)
    at org.meridor.perspective.sql.impl.QueryPlannerImpl.lambda$preprocessFixedValueConditions$76(QueryPlannerImpl.java:447)
    at java.lang.Iterable.forEach(Iterable.java:75)
    at org.meridor.perspective.sql.impl.QueryPlannerImpl.preprocessFixedValueConditions(QueryPlannerImpl.java:444)
    at org.meridor.perspective.sql.impl.QueryPlannerImpl.getIndexScanBooleanExpression(QueryPlannerImpl.java:408)
    at org.meridor.perspective.sql.impl.QueryPlannerImpl.lambda$createOptimizedDataSource$73(QueryPlannerImpl.java:293)
    at org.meridor.perspective.sql.impl.parser.DataSourceUtils.iterateDataSource(DataSourceUtils.java:108)
    at org.meridor.perspective.sql.impl.parser.DataSourceUtils.iterateDataSource(DataSourceUtils.java:95)
    at org.meridor.perspective.sql.impl.QueryPlannerImpl.createOptimizedDataSource(QueryPlannerImpl.java:268)
    at org.meridor.perspective.sql.impl.QueryPlannerImpl.optimizeDataSource(QueryPlannerImpl.java:189)
    at org.meridor.perspective.sql.impl.QueryPlannerImpl.optimizeSelectQuery(QueryPlannerImpl.java:140)
    at org.meridor.perspective.sql.impl.QueryPlannerImpl.processSelectQuery(QueryPlannerImpl.java:81)
    ... 47 more
2016-10-18 13:54:58,400 [             XNIO-1 I/O-1] DEBUG org.meridor.perspective.rest.resources.InstancesResource     - Query #5 results = [0 rows, status = evaluation_error, message = <empty>]