Re: Understanding annotations of SqlGroupingFunction

2020-04-23 Thread Julian Hyde
Doesn’t help much. It’s not obvious to me what “being grouped” means. Julian > On Apr 21, 2020, at 23:52, XING JIN wrote: > > Hi Vineet ~ > +1 on your analysis. > Checking below case in agg.iq. We can see that the behavior of GROUPING > function in Calcite is the same as Hive. > > #

Re: Understanding annotations of SqlGroupingFunction

2020-04-22 Thread XING JIN
Filed a JIRA: https://issues.apache.org/jira/browse/CALCITE-3950 XING JIN 于2020年4月22日周三 下午2:51写道: > Hi Vineet ~ > +1 on your analysis. > Checking below case in agg.iq. We can see that the behavior of GROUPING > function in Calcite is the same as Hive. > > # GROUPING in SELECT clause of CUBE

Re: Understanding annotations of SqlGroupingFunction

2020-04-22 Thread XING JIN
Hi Vineet ~ +1 on your analysis. Checking below case in agg.iq. We can see that the behavior of GROUPING function in Calcite is the same as Hive. # GROUPING in SELECT clause of CUBE query select deptno, job, count(*) as c, grouping(deptno) as d, grouping(job) j, grouping(deptno, job) as x from

Re: Understanding annotations of SqlGroupingFunction

2020-04-21 Thread Vineet G
I expect that the user behavior for the GROUPING in both hive and calcite is same. It’s just the documentation which is a bit confusing. e.g. comment line on grouping : if both deptno and gender are being grouped should really mean that the row which represents the grand total i.e without

Re: Understanding annotations of SqlGroupingFunction

2020-04-21 Thread Julian Hyde
Suppose we have one row that represents the total for department 10, and another that represents the grand total of all departments. Which row would we say that department is “grouped” (in Calcite’s parlance) or “aggregated” in (Hive’s parlance)? I find the terms confusing. It’s possible that

Understanding annotations of SqlGroupingFunction

2020-04-20 Thread ZZY
Hi, Hyde: It's confused me that some annotations in Calcite(org.apache.calcite.sql.fun.SqlGroupingFunction.java) : /** * The {@code GROUPING} function. * * Accepts 1 or more arguments. * Example: {@code GROUPING(deptno, gender)} returns * 3 if both deptno and gender are being grouped, * 2 if