You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/06/28 19:42:12 UTC

[GitHub] [druid] pcallahan-r7 opened a new issue #11390: SQL Query fails to return expected results with scalar function wrapping an aggregate function in an inner query.

pcallahan-r7 opened a new issue #11390:
URL: https://github.com/apache/druid/issues/11390


   Please provide a detailed title (e.g. "Broker crashes when using TopN query with Bound filter" instead of just "Broker crashes").
   
   ### Affected Version
   
   0.20.1
   
   ### Description
   
   Using the wikipedia tutorial data, this query works fine.   Note the `SUM(added)` in the inner query.
   ```sql
   select DS_GET_QUANTILE(DS_QUANTILES_SKETCH(xxxx), 0.5) AS test 
   FROM
   (select countryIsoCode, SUM(added) AS xxxx 
   FROM wikipedia
   GROUP BY 1 
   having xxxx > 0)
   ```
   
   Now change the query to be `ABS(SUM(added))` and no results are produced.   Expected the same result.    Note the `having` clause must be present to observe this defect.
   
   Also note I believe this has been fixed in the latest version of Imply druid.
   
   full query that fails:
   
   ```sql
   select DS_GET_QUANTILE(DS_QUANTILES_SKETCH(xxxx), 0.5) AS test 
   FROM
   (select countryIsoCode, ABS(SUM(added)) AS xxxx 
   FROM wikipedia
   GROUP BY 1 
   having xxxx > 0)
   ```
   
   - Cluster size:  micro
   - Configurations in use:  wikipedia tutorial data
   


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