Generate a empty Aggregate after RelFieldTrimmer#trim

2020-10-20 Thread JiaTao Tao
Hi fellows I found this in my plan, after RelFieldTrimmer#trim, `relBuilder.aggregate(groupKey, newAggCallList);`, the groupKey and newAggCallList are all empty, I think it doesn't meet expectations. LogicalAggregate(group=[{}]) LogicalAggregate(group=[{0, 1, 2}]) Regards! Aron Tao

Re: [QUESTION] Does SQL standard allows project nested fields for aggregate ?

2020-10-20 Thread Danny Chan
Thanks, it works ~ I didn’t find evidence that SQL standard does not support this, at least, the semantic is clear. Best, Danny Chan 在 2020年10月21日 +0800 AM7:58,Jinfeng Ni ,写道: > SELECT f0.a, max(f1) FROM t1 GROUP BY f0 > > I think the problem with the 1st query is that the parser is confused >

Re: [QUESTION] Does SQL standard allows project nested fields for aggregate ?

2020-10-20 Thread Jinfeng Ni
SELECT f0.a, max(f1) FROM t1 GROUP BY f0 I think the problem with the 1st query is that the parser is confused with 'f0' being a table or column name. PostgrelSQL doc [1] suggests to use () to denote column, and the part after () to denote the subfield. In your case, the query should be: SELECT

Re: [QUESTION] Does SQL standard allows project nested fields for aggregate ?

2020-10-20 Thread Julian Hyde
I think that your first query, SELECT f0.a, max(f1) FROM t1 GROUP BY f0 should be valid. I don't know whether the SQL standard thinks it should be valid, or whether Calcite can handle it. And I don't know why PostgreSQL has a problem with it. Julian On Mon, Oct 19, 2020 at 9:41 PM Danny Chan

[jira] [Created] (CALCITE-4348) Materialization recognition fails when query has calculation expression

2020-10-20 Thread xzh_dz (Jira)
xzh_dz created CALCITE-4348: --- Summary: Materialization recognition fails when query has calculation expression Key: CALCITE-4348 URL: https://issues.apache.org/jira/browse/CALCITE-4348 Project: Calcite

[jira] [Created] (CALCITE-4347) Illegal use of dynamic parameter when use preparestatement

2020-10-20 Thread yangzhang (Jira)
yangzhang created CALCITE-4347: -- Summary: Illegal use of dynamic parameter when use preparestatement Key: CALCITE-4347 URL: https://issues.apache.org/jira/browse/CALCITE-4347 Project: Calcite