Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Hi, all.
Here, Aggregate of of no-group and no-agg-call coverting to sql is fail.
For example:
@Test void testAggregateWithNoGroupAndNoAggCall() { final RelBuilder builder = relBuilder(); final RelNode relRoot = builder.scan("EMP") .aggregate(builder.groupKey()) .project(ImmutableList.of(builder.literal("hello")), ImmutableList.of("constant_field")) .build(); String expected = "SELECT 'hello' AS \"constant_field\"\n" + "FROM \"scott\".\"EMP\""; relFn(b -> relRoot).ok(expected); }
This case will return sql:
SELECT 'hello' AS "constant_field" FROM "scott"."EMP" GROUP BY ()
--------------------------------------
Should we use a switch of dialect to control this conversion, which is code of `org.apache.calcite.rel.rel2sql.RelToSqlConverter#buildAggregate`?
Attachments
Attachments
Issue Links
- is related to
-
CALCITE-4597 Allow RelNodes to have an empty row type (zero fields)
- Open