You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "gianm (via GitHub)" <gi...@apache.org> on 2025/07/03 11:30:23 UTC

[I] MSQ: Missing join on realtime subquery (druid)

gianm opened a new issue, #18198:
URL: https://github.com/apache/druid/issues/18198

   On the wikipedia dataset, this query yields incorrect results on realtime data:
   
   ```sql
   SELECT COUNT(*) FROM "wikipedia"
   WHERE countryName IN (
     SELECT countryName
     FROM "wikipedia"
     WHERE countryName IS NOT NULL
     GROUP BY 1
     ORDER BY COUNT(*) DESC
     LIMIT 1
   )
   ```
   
   The query results are the same as `SELECT COUNT(*) FROM "wikipedia"`. Under the hood this query runs using a broadcast join. It may be that the `join` datasource is not being correctly passed down to the realtime server.


-- 
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@druid.apache.org.apache.org

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


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


Re: [I] MSQ: Missing join on realtime subquery (druid)

Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe closed issue #18198: MSQ: Missing join on realtime subquery
URL: https://github.com/apache/druid/issues/18198


-- 
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@druid.apache.org

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


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


Re: [I] MSQ: Missing join on realtime subquery (druid)

Posted by "gianm (via GitHub)" <gi...@apache.org>.
gianm commented on issue #18198:
URL: https://github.com/apache/druid/issues/18198#issuecomment-3032211233

   Test cases in #18201: https://github.com/apache/druid/pull/18201/files#diff-4232936da3f4238f5cd8100dbbaa72e37534c88c7b515d5b5b3a9b593dd313d1R278-R320


-- 
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@druid.apache.org

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


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


Re: [I] MSQ: Missing join on realtime subquery (druid)

Posted by "adarshsanjeev (via GitHub)" <gi...@apache.org>.
adarshsanjeev commented on issue #18198:
URL: https://github.com/apache/druid/issues/18198#issuecomment-3034773379

   I looked into this a bit. 
   In a way, it is due to the join not being passed to the server. Since the join can be with a stage output etc, the realtime query might not be able to handle doing these operations in all cases.
   
   The join or unnest information is passed in the `mapSegment` function already, so fix might be to call it on the results of the realtime query.


-- 
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@druid.apache.org

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


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


Re: [I] MSQ: Missing join on realtime subquery (druid)

Posted by "adarshsanjeev (via GitHub)" <gi...@apache.org>.
adarshsanjeev commented on issue #18198:
URL: https://github.com/apache/druid/issues/18198#issuecomment-3035838659

   Actually, thinking more about it, having the results be wrapped in a segment which is then mapped using the function would fix the issue for the `ScanQueryFrameProcessor`, however, for the `GroupByFrameProcessor`, it would require the mapping to be done before the grouping done on the realtime task, so that wouldn't work.


-- 
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@druid.apache.org

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


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