LakshSingla commented on code in PR #14886:
URL: https://github.com/apache/druid/pull/14886#discussion_r1316392139
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/BaseLeafFrameProcessor.java:
##########
@@ -107,7 +113,8 @@ private static Pair<List<ReadableFrameChannel>,
BroadcastJoinHelper> makeInputCh
inputChannels.add(baseInput.getChannel());
}
- if (dataSource instanceof JoinDataSource) {
+
+ if (dataSource instanceof JoinDataSource || dataSource instanceof
UnnestDataSource || dataSource instanceof FilteredDataSource) {
Review Comment:
Seeing the same pattern as above, it should be a good refactor candidate.
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/BaseLeafFrameProcessor.java:
##########
@@ -96,7 +98,11 @@ private static Pair<List<ReadableFrameChannel>,
BroadcastJoinHelper> makeInputCh
final long memoryReservedForBroadcastJoin
)
{
- if (!(dataSource instanceof JoinDataSource) && !sideChannels.isEmpty()) {
+ // An UnnestDataSource or FilteredDataSource can have a join as a base
+ // In such a case a side channel is expected to be there
+ if (!(dataSource instanceof JoinDataSource
+ || dataSource instanceof UnnestDataSource
Review Comment:
nit: If we are keeping it as is, then there should be a better pattern than
doing an instanceof for all.
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/BaseLeafFrameProcessor.java:
##########
@@ -96,7 +98,11 @@ private static Pair<List<ReadableFrameChannel>,
BroadcastJoinHelper> makeInputCh
final long memoryReservedForBroadcastJoin
)
{
- if (!(dataSource instanceof JoinDataSource) && !sideChannels.isEmpty()) {
+ // An UnnestDataSource or FilteredDataSource can have a join as a base
+ // In such a case a side channel is expected to be there
+ if (!(dataSource instanceof JoinDataSource
+ || dataSource instanceof UnnestDataSource
Review Comment:
Question:
What happens if we have a simple unnest query like -
```sql
SELECT * FROM tab1,UNNEST(col1)
```
What is expected to be in the side channel then? Seems like that they should
be empty in this case
--
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]