Multiple and operators in single case when statement

43 views
Skip to first unread message

shubha...@zeotap.com

unread,
Mar 5, 2018, 3:55:14 PM3/5/18
to Druid User
Hi,

We are running on 0.11.0 and I am facing issues while querying for multiple AND operator conditions in a single case when clause. I am querying using json sql query mode. Here is an example :

{"query" : "SELECT demographic_gender,CASE WHEN (telco_arpu > 141 and telco_arpu <= 373 and telco_datausage <= 998) THEN 'Low' ELSE null END AS demographic_incomebucket,count(distinct impressions) as impressions FROM \"zai-v2-ind\" WHERE (input_sourceid = '100' AND cast(__time as date) >= '2017-12-01' AND cast(__time as date) <= '2018-03-05' AND profile_flag = 'true') GROUP BY demographic_gender,CASE WHEN (telco_arpu > 141 and telco_arpu <= 373 and telco_datausage <= 998) THEN 'Low' ELSE null END"}

And following is the error :

{"error":"Unknown exception","errorMessage":"Error while applying rule DruidQueryRule:SELECT_PROJECT, args [rel#4844:LogicalProject.NONE.[](input=rel#4842:Subset#6.NONE.[],demographic_gender=$4,demographic_incomebucket=CASE(AND(>($36, 141), <=($36, 373), <=($38, 998)), 'Low', null),impressions=$19) ......(followed by query, fields, columns, signature etc.)


Query with two or less expressions for AND operator works fine. Is this expected ? Any help would be appreciated.


Thanks,

Shubham Patil


Gian Merlino

unread,
Mar 5, 2018, 4:58:46 PM3/5/18
to druid...@googlegroups.com
Hi Shubham,

Looks like a bug, I raised an issue here: https://github.com/druid-io/druid/issues/5468. Thanks for reporting it.

Gian

--
You received this message because you are subscribed to the Google Groups "Druid User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to druid-user+unsubscribe@googlegroups.com.
To post to this group, send email to druid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/druid-user/f26674f8-b064-4840-b7d3-3be9e0824548%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages