You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "gyorfimi (via GitHub)" <gi...@apache.org> on 2024/01/18 18:46:56 UTC

[I] Multistage query failure when select a CASE/IN expression [pinot]

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

   Hi!
   
   Using version 1.0.0, we have a query like this:
   
   ````
   select CASE WHEN m IN ('A','B') THEN 'C' ELSE m END from
   (select v1.v,  v2.m from sztable v1 inner join sztable v2 on v1.szid=v2.szid) d
   where v in  ('A', 'B', 'C', 'D')
    limit 10
   ````
   
   Executing this **multistage** query gives:
   
   ````
   Error Code: 200
   
   QueryExecutionError:
   Unable to execute query plan at stage 2 on server 172.21.0.5@{43169,45365}: ERROR: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Cannot find function with name: IN
   	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
   	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2022)
   	at org.apache.pinot.query.service.SubmissionService.awaitFinish(SubmissionService.java:49)
   	at org.apache.pinot.query.service.server.QueryServer.submit(QueryServer.java:121)
   ...
   Caused by: java.lang.IllegalStateException: Cannot find function with name: IN
   	at org.apache.pinot.shaded.com.google.common.base.Preconditions.checkState(Preconditions.java:601)
   	at org.apache.pinot.query.runtime.operator.operands.FunctionOperand.<init>(FunctionOperand.java:51)
   	at org.apache.pinot.query.runtime.operator.operands.TransformOperandFactory.getTransformOperand(TransformOperandFactory.java:77)
   	at org.apache.pinot.query.runtime.operator.operands.TransformOperandFactory.getTransformOperand(TransformOperandFactory.java:34)
   org.apache.pinot.query.service.dispatch.QueryDispatcher.submit(QueryDispatcher.java:149)
   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)
   ````
   
   if I don't use the IN expression in CASE in the projection part of the SELECT, the query runs well. (`SELECT m FROM ...`)
   
   


-- 
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: commits-unsubscribe@pinot.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [I] Multistage query failure when select a CASE/IN expression [pinot]

Posted by "gyorfimi (via GitHub)" <gi...@apache.org>.
gyorfimi commented on issue #12285:
URL: https://github.com/apache/pinot/issues/12285#issuecomment-1899032204

   I've made a little change in `TransformOperandFactory`, putting the 'IN' and 'NOT_IN' operator in the case expression:
   ````
   private static TransformOperand getTransformOperand(RexExpression.FunctionCall functionCall, DataSchema dataSchema) {
       List<RexExpression> operands = functionCall.getFunctionOperands();
       int numOperands = operands.size();
       String canonicalName = OperatorUtils.canonicalizeFunctionName(functionCall.getFunctionName());
       switch (canonicalName) {
         case "IN":
           Preconditions.checkState(numOperands >= 2, "IN takes >=2 arguments, got: %s", numOperands);
           return new FilterOperand.In(operands, dataSchema, false);
         case "NOT_IN":
           Preconditions.checkState(numOperands >= 2, "NOT_IN takes >=2 arguments, got: %s", numOperands);
           return new FilterOperand.In(operands, dataSchema, true);
         case "AND":
        .....
   ````         
   
   And I've implemented the `In` class, the engine starts working well. I'm not sure, this is the good solution, but it seems to be a fix.
         


-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [I] Multistage query failure when select a CASE/IN expression [pinot]

Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang closed issue #12285: Multistage query failure when select a CASE/IN expression
URL: https://github.com/apache/pinot/issues/12285


-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [I] Multistage query failure when select a CASE/IN expression [pinot]

Posted by "gyorfimi (via GitHub)" <gi...@apache.org>.
gyorfimi commented on issue #12285:
URL: https://github.com/apache/pinot/issues/12285#issuecomment-1904493186

   
   #12305


-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [I] Multistage query failure when select a CASE/IN expression [pinot]

Posted by "walterddr (via GitHub)" <gi...@apache.org>.
walterddr commented on issue #12285:
URL: https://github.com/apache/pinot/issues/12285#issuecomment-1901012356

   Sweet!!!! thank you for reproducing this issue. will take a look!!


-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org