himanshug commented on issue #9122: Add SQL GROUPING SETS support.
URL: https://github.com/apache/druid/pull/9122#issuecomment-589828549
 
 
   > Alter behavior so limitSpec is applied after subtotalsSpec, rather than 
applied to
   each grouping set. This is more in line with SQL standard behavior. I think 
it is okay
   to make this change, since the old behavior was not documented, so users 
should
   hopefully not be depending on it.
   
   saw this today, I think, with original behavior, I tried to replicate 
semantics equivalent of sending separate  queries for each subtotalsSpec 
individual (pre subtotalsSpec world) . That was the usecase at hand when 
subtotalsSpec feature  was created. However, I can't recall if that usecase 
    did have needs for limitSpec.  @a2l007 do you know if there is dependency 
of  limit/sort spec  behavior when subtotalsSpecs  are used  ?
   If a limitSpec (containing sort  spec) is applied in  the end then  that 
will mixup the rows and it would be difficult to identify  which rows  came 
from overall or which subtotalSpec .  Oracle appears to support  GROUPING 
function (Ref: 
https://docs.oracle.com/cd/B28359_01/server.111/b28314/tdpdw_sql.htm#TDPDW00714 
) to solve that problem in addition to having the behavior you described from 
`ROLLUP` and `CUBE` functions by adding '1' for dims not present in subtotal 
spec for rows created by  subtotalSpec.
   For native query users, what would be the alternative to achieve similar 
effect? For  this reason,  it might be good to have a feature flag for enabling 
`old` behavior .
   

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to