gianm commented on pull request #9986:
URL: https://github.com/apache/druid/pull/9986#issuecomment-638905062


   This seems like a logic error somewhere. Throwing a 
CannotBuildQueryException abandons the current partial query and, if there's 
another path available, will cause that other path to be gone down instead. 
This doesn't seem like an ideal solution. There might be some queries where 
there is no alternate path. The logic error might cause other problems besides 
exceptions. So it would be better to identify and correct the logic error.
   
   The loop you modified is assuming that the positions in 
`aggregate.getGroupSet()` are all referring to fields in the `rowSignature` 
(`dimBitMapping` was initialized to `rowSignature.size()`). This sounds 
reasonable to me, because the group set is all the input fields that we are 
grouping on, and the `rowSignature` is the input row signature. It comes from 
`computeOutputRowSignature(sourceRowSignature, selectProjection, null, null)`, 
which is the source data plus any pre-aggregation projections 
(`selectProjection`).
   
   But there must be something wrong somewhere if we're getting dimBits that 
are lying outside the `rowSignature`. The error might be in `computeSubtotals` 
or perhaps in whatever created the `partialQuery` and `rowSignature` that it is 
being given. Maybe there is something, somewhere, that is eliminating literals, 
and reflecting that in `rowSignature` but not in `partialQuery.getAggregate()`. 
If I was you I would look for this kind of thing first.
   
   Please look a little deeper and see if you can find the place that the logic 
breaks down.
   
   Thanks!


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

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