dorlevi opened a new issue, #12670:
URL: https://github.com/apache/pinot/issues/12670

   On Pinot V1 and on the new RC there are some issues with equality/inequality.
   
   We first noticed this issue as we were trying to use != and <> operators on 
a big_decimal field and we gotten a general error:
   
   SELECT owner_addr, balance_value AS balance_at_max_block
   FROM _table_
   WHERE (owner_addr, block_number) IN (
       SELECT owner_addr, MAX(block_number)
       FROM _table_
       GROUP BY owner_addr
   )
   AND balance_value > 0
   
   Would succeed but the same query with just balance_value <> 0 or 
balance_value != 0
   would fail with this error
   
   ```2024/03/18 18:26:55.129 ERROR [MultiStageBrokerRequestHandler] 
[jersey-server-managed-async-executor-3] Caught exception executing request 
324508047000000104: SELECT owner_addr, balance_value AS balance_at_max_block
   FROM _table_
   WHERE (owner_addr, block_number) IN (
       SELECT owner_addr, MAX(block_number)
       FROM _table_
       GROUP BY owner_addr
   )
   AND balance_value !=0, Error dispatching query to 
server=pinot-server-1.pinot-server-headless.pinot.svc.cluster.local@{7321,7732} 
stage=2
   
org.apache.pinot.query.service.dispatch.QueryDispatcher.submit(QueryDispatcher.java:144)
   
org.apache.pinot.query.service.dispatch.QueryDispatcher.submitAndReduce(QueryDispatcher.java:93)
   
org.apache.pinot.broker.requesthandler.MultiStageBrokerRequestHandler.handleRequest(MultiStageBrokerRequestHandler.java:179)
   
org.apache.pinot.broker.requesthandler.BaseBrokerRequestHandler.handleRequest(BaseBrokerRequestHandler.java:263)
   INVALID_ARGUMENT: Bad request
   io.grpc.Status.asRuntimeException(Status.java:539)
   
io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:487)
   io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:576)
   io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70)
   ```
   
   We then tried to updated to the latest RC version, sadly this didn’t help 
getting these queries to work but the error message changed to something more 
informative 
   
   
   ```
   Error Code: 200
   QueryExecutionError:
   Unable to execute query plan for request: 324508047000000030 on server: 
pinot-server-1.pinot-server-headless.pinot.svc.cluster.local@{7321,7732}, 
ERROR: java.util.concurrent.ExecutionException: java.lang.RuntimeException: 
Caught exception while deserializing stage plan for request: 
324508047000000030, stage: 2
        at 
java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
        at 
java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
        at 
org.apache.pinot.query.service.server.QueryServer.submit(QueryServer.java:156)
        at 
org.apache.pinot.common.proto.PinotQueryWorkerGrpc$MethodHandlers.invoke(PinotQueryWorkerGrpc.java:284)
   ...
   Caused by: java.lang.RuntimeException: Caught exception while deserializing 
stage plan for request: 324508047000000030, stage: 2
        at 
org.apache.pinot.query.service.server.QueryServer.lambda$submit$1(QueryServer.java:126)
        at 
java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
        ... 3 more
   Caused by: java.lang.IllegalStateException: Unable to create Object of type: 
java.math.BigDecimal
        at 
org.apache.pinot.query.planner.serde.ProtoSerializationUtils.constructObject(ProtoSerializationUtils.java:252)
        at 
org.apache.pinot.query.planner.serde.ProtoSerializationUtils.constructMemberVariable(ProtoSerializationUtils.java:194)
        at 
org.apache.pinot.query.planner.serde.ProtoSerializationUtils.setObjectFieldToObject(ProtoSerializationUtils.java:59)
        at 
org.apache.pinot.query.planner.serde.ProtoSerializationUtils.constructObject(ProtoSerializationUtils.java:248)
   ...
   Caused by: java.lang.InstantiationException: java.math.BigDecimal
        at java.base/java.lang.Class.newInstance(Class.java:639)
        at 
org.apache.pinot.query.planner.serde.ProtoSerializationUtils.constructObject(ProtoSerializationUtils.java:247)
        ... 20 more
   Caused by: java.lang.NoSuchMethodException: java.math.BigDecimal.<init>()
        at java.base/java.lang.Class.getConstructor0(Class.java:3585)
        at java.base/java.lang.Class.newInstance(Class.java:626)
        ... 21 more
   
org.apache.pinot.query.service.dispatch.QueryDispatcher.submit(QueryDispatcher.java:206)
   
org.apache.pinot.query.service.dispatch.QueryDispatcher.submitAndReduce(QueryDispatcher.java:97)
   
org.apache.pinot.broker.requesthandler.MultiStageBrokerRequestHandler.handleRequest(MultiStageBrokerRequestHandler.java:199)
   
org.apache.pinot.broker.requesthandler.BaseBrokerRequestHandler.handleRequest(BaseBrokerRequestHandler.java:290)
   ```
   
   We’ve also noticed that even simple queries that use equality fail
   `select * from _table_ where from_addr = 
X'7f86bf177dd4f3494b841a37e810a34dd56c829b' and value = 18431688187`
   fail, with this error message
   ```
   Caused by: java.lang.InstantiationException: java.math.BigDecimal
        at java.base/java.lang.Class.newInstance(Class.java:639)
        at 
org.apache.pinot.query.planner.serde.ProtoSerializationUtils.constructObject(ProtoSerializationUtils.java:247)
        ... 25 more
   Caused by: java.lang.NoSuchMethodException: java.math.BigDecimal.<init>()
   ```
   yet
   
   `select * from_table where from_addr = 
X'7f86bf177dd4f3494b841a37e810a34dd56c829b' and value >= 18431688187 and value 
<= 18431688187`
   
   works, **so it’s something about equality and inequality specifically on big 
decimals**
   
   [see slack thread for more 
context](https://apache-pinot.slack.com/archives/C011C9JHN7R/p1710530137069059)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to