[
https://issues.apache.org/jira/browse/KYLIN-5707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hongrong Cao updated KYLIN-5707:
--------------------------------
Description:
grouping sets of the two fields alone, the query are two results, written
together is three results (the expectation is that 4).
The phenomenon is like the two fields as a group to group by (in fact, I want
to write two groups), in addition, such as the following sql, grouping sets can
not be added () for example, written as grouping sets ((case when xx...) ,(case
when xx...)) will report an error.
{quote}select
--case when T2.HQF_SIGN='1' then 'DONE' else 'DONE' end HQF_SIGN
case when T3.STATE='1' then 'DONE' else 'DONE' END STATE
,GROUPING(case when T3.STATE='1' then 'DONE' else 'DONE' END) as active_group
,count(distinct case when 1=1 then t1.party_id else null end) as goal_group
from
db.main_table as T1
left join
db.extra_info as T2
on T1.PARTY_iD=T2.PARTY_iD
left join
jzh.company_info as T3
on T1.PARTY_iD=T3.PARTY_iD
group by
--case when T2.HQF_SIGN='1' then 'DONE' else 'DONE' end
--,case when T3.STATE='1' then 'DONE' else 'DONE' END
GROUPING SETS
--(case when T2.HQF_SIGN='1' then 'DONE' else 'DONE' end)
(case when T3.STATE='1' then 'DONE' else 'DONE' END)
LIMIT 500
{quote}
was:update calcite to 1.116.0-kylin-4.x-r028
> When the case when expression is included in Grouping sets, the query reports
> an error
> --------------------------------------------------------------------------------------
>
> Key: KYLIN-5707
> URL: https://issues.apache.org/jira/browse/KYLIN-5707
> Project: Kylin
> Issue Type: Bug
> Affects Versions: 5.0-beta
> Reporter: Hongrong Cao
> Assignee: Ruixuan Zhang
> Priority: Major
> Fix For: 5.0.0
>
>
> grouping sets of the two fields alone, the query are two results, written
> together is three results (the expectation is that 4).
> The phenomenon is like the two fields as a group to group by (in fact, I want
> to write two groups), in addition, such as the following sql, grouping sets
> can not be added () for example, written as grouping sets ((case when xx...)
> ,(case when xx...)) will report an error.
>
> {quote}select
> --case when T2.HQF_SIGN='1' then 'DONE' else 'DONE' end HQF_SIGN
> case when T3.STATE='1' then 'DONE' else 'DONE' END STATE
> ,GROUPING(case when T3.STATE='1' then 'DONE' else 'DONE' END) as active_group
> ,count(distinct case when 1=1 then t1.party_id else null end) as goal_group
> from
> db.main_table as T1
> left join
> db.extra_info as T2
> on T1.PARTY_iD=T2.PARTY_iD
> left join
> jzh.company_info as T3
> on T1.PARTY_iD=T3.PARTY_iD
> group by
> --case when T2.HQF_SIGN='1' then 'DONE' else 'DONE' end
> --,case when T3.STATE='1' then 'DONE' else 'DONE' END
> GROUPING SETS
> --(case when T2.HQF_SIGN='1' then 'DONE' else 'DONE' end)
> (case when T3.STATE='1' then 'DONE' else 'DONE' END)
> LIMIT 500
> {quote}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)