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 2019/07/12 00:17:29 UTC

[GitHub] [incubator-druid] ajcrutch commented on issue #7953: Exact distinct-COUNT with complex expression (CASE, IN) throws NullPointerException

ajcrutch commented on issue #7953: Exact distinct-COUNT with complex expression (CASE, IN) throws NullPointerException
URL: https://github.com/apache/incubator-druid/issues/7953#issuecomment-510698252
 
 
   Spoke to Julian, seems this might also be related.
   
   This query works fine when the count(*) is removed, but yields an error when it or any other measure is in there.  Seems like a "filtered" count distinct cannot play nice with even one additional measure in the query.  Approx count distinct is false.
   
   SELECT 
   COUNT(*) AS "sales_order_detail.count",
   COUNT(DISTINCT (case when sales_order_detail.source_system_id = '7' then sales_order_detail.order_nbr else null end )) AS "sales_order_detail.return_orders"
   FROM  druid.sales_order_detail  AS sales_order_detail
   LIMIT 500
   
   Here's the error:
   The Druid database encountered an error while running this query.
   Error -1 (00000) : Error while executing SQL 
   Remote driver error: RuntimeException: Error while applying rule AggregateExpandDistinctAggregatesRule, args [rel#25710:LogicalAggregate.NONE.[](input=rel#25709:Subset#6.NONE.[],group={},sales_order_detail.count=COUNT(),sales_order_detail.return_orders=COUNT(DISTINCT $1) FILTER $2)] -> NullPointerException: (null exception message)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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