See calcite syntaxis <https://calcite.apache.org/docs/reference.html#aggregate-functions> I think isnt allowed: Agg ( distinct case) You can try with: Agg ( distinct value)
2016-12-27 9:41 GMT+01:00 Billy Liu <billy...@apache.org>: > When you talk about mismatch result, you'd better provide the sample data > and actual result. Otherwise, nobody could reproduce your issue easily. > > 2016-12-27 16:13 GMT+08:00 徐 鹏 <xupeng1...@outlook.com>: > >> HI all: >> Query1: >> SELECT COUNT(DISTINCT CASE WHEN pagefiltername IN >> (‘homepage') THEN t.loginkey END) AS homepageuv >> FROM fly t >> WHERE yyyymmdd='20161222’ >> Query2: >> SELECT COUNT(DISTINCT t.loginkey ) AS homepageuv FROM fly >> t WHERE yyyymmdd='20161222' and pagefiltername IN ('homepage') ; >> >> expected :Query1=Query2 >> actual:Query1 !=Query2 >> >> What’s wrong? >> >> >> Regards, >> Peng Xu >> xupeng1...@outlook.com >> >> >> >> >> >> >> > > >