You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "dang-stripe (via GitHub)" <gi...@apache.org> on 2026/02/04 04:51:02 UTC

[I] [multistage] lookup join on empty dim table causes `bound must be positive` error [pinot]

dang-stripe opened a new issue, #17625:
URL: https://github.com/apache/pinot/issues/17625

   Got the following query failure when doing a lookup join on an empty dim table: 
   
   Query
   ```
   SELECT /*+ joinOptions(join_strategy='lookup') */
   FROM table1 JOIN table2 ON table1.key = table2.key
   LIMIT 5
   ```
   
   Logs
   ```
   WARN [MultiStageBrokerRequestHandler] [jersey-server-managed-async-executor-112:687] Request 1234 failed with exception
   [2026-02-03 22:36:09.020228] org.apache.pinot.spi.exception.QueryException: Error while planning query
   ...
   [2026-02-03 22:36:09.020930] Caused by: java.lang.RuntimeException: Error composing query plan for 'SELECT /*+ joinOptions(join_strategy='lookup') */  FROM table1 JOIN table2 ON table1.key = table2.key LIMIT 5': bound must be positive'
   [2026-02-03 22:36:09.020951] 	at org.apache.pinot.query.QueryEnvironment$CompiledQuery.planQuery(QueryEnvironment.java:967)
   [2026-02-03 22:36:09.020967] 	at org.apache.pinot.broker.requesthandler.MultiStageBrokerRequestHandler.lambda$query$5(MultiStageBrokerRequestHandler.java:546)
   [2026-02-03 22:36:09.020980] 	at org.apache.pinot.spi.query.QueryThreadContext$1.lambda$decorate$0(QueryThreadContext.java:190)
   [2026-02-03 22:36:09.020985] 	... 4 more
   [2026-02-03 22:36:09.020996] Caused by: java.lang.IllegalArgumentException: bound must be positive
   [2026-02-03 22:36:09.021005] 	at java.base/java.util.Random.nextInt(Random.java:557)
   [2026-02-03 22:36:09.021017] 	at org.apache.pinot.query.routing.WorkerManager.assignWorkersToIntermediateFragment(WorkerManager.java:241)
   [2026-02-03 22:36:09.021034] 	at org.apache.pinot.query.routing.WorkerManager.assignWorkersToNonRootFragment(WorkerManager.java:147)
   [2026-02-03 22:36:09.021046] 	at org.apache.pinot.query.routing.WorkerManager.assignWorkers(WorkerManager.java:114)
   [2026-02-03 22:36:09.021060] 	at org.apache.pinot.query.planner.physical.PinotDispatchPlanner.createDispatchableSubPlan(PinotDispatchPlanner.java:70)
   [2026-02-03 22:36:09.021072] 	at org.apache.pinot.query.QueryEnvironment.toDispatchableSubPlan(QueryEnvironment.java:519)
   [2026-02-03 22:36:09.021083] 	at org.apache.pinot.query.QueryEnvironment.toDispatchableSubPlan(QueryEnvironment.java:501)
   [2026-02-03 22:36:09.021095] 	at org.apache.pinot.query.QueryEnvironment$CompiledQuery.planQuery(QueryEnvironment.java:962)
   ```
   
   Which points to https://github.com/apache/pinot/blob/441d335dcf04647c34353aec9213c8361f4009a0/pinot-query-planner/src/main/java/org/apache/pinot/query/routing/WorkerManager.java#L241


-- 
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 with limit fails with `bound must be positive` error when tables have no data [pinot]

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

   Thanks for fixing this!


-- 
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 with limit fails with `bound must be positive` error when tables have no data [pinot]

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

   Thanks, that makes sense. I'm able to reproduce this with a simple query on quickstart like `select * from baseballStats limit 10` when `baseballStats` has no segments (sort / limit queries have a singleton worker for the global sort, and so the buggy code path is triggered). I'll create a fix for this soon.


-- 
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 with limit fails with `bound must be positive` error when tables have no data [pinot]

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

   Thanks for looking! Yes we are using that feature.


-- 
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 with limit fails with `bound must be positive` error when tables have no data [pinot]

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

   I'm not able to reproduce this issue. In [this method](https://github.com/apache/pinot/blob/441d335dcf04647c34353aec9213c8361f4009a0/pinot-query-planner/src/main/java/org/apache/pinot/query/routing/WorkerManager.java#L360), if the servers serving the tables come back as empty, we default to using all the enabled servers [here](https://github.com/apache/pinot/blob/441d335dcf04647c34353aec9213c8361f4009a0/pinot-query-planner/src/main/java/org/apache/pinot/query/routing/WorkerManager.java#L398-L407). Are you using this feature - https://github.com/apache/pinot/pull/16084?


-- 
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 with limit fails with `bound must be positive` error when tables have no data [pinot]

Posted by "yashmayya (via GitHub)" <gi...@apache.org>.
yashmayya closed issue #17625: [multistage] query with limit fails with `bound must be positive` error when tables have no data
URL: https://github.com/apache/pinot/issues/17625


-- 
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