Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ private static SqlNode createDatetimeCastSpec(String typeAlias, RelDataType type
return false;
}

@Override public boolean supportsGroupByLiteral() {
return false;
}

@Override public boolean supportsGroupByWithRollup() {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,13 @@ private static RelNode sqlToRel(String sql, SchemaPlus defaultSchema,
+ "(SELECT TRUE AS \"$f0\") AS \"t\"\nGROUP BY \"t\".\"$f0\"";
String expectedInformix = "SELECT AVG(employee.salary)\nFROM foodmart.employee,"
+ "\n(SELECT TRUE AS $f0) AS t\nGROUP BY t.$f0";
String expectedMssql = "SELECT AVG([employee].[salary])\n"
+ "FROM [foodmart].[employee],\n"
+ "(VALUES (1)) AS [t] ([$f0])\nGROUP BY [t].[$f0]";
sql(query)
.withRedshift().ok(expectedRedshift)
.withInformix().ok(expectedInformix);
.withInformix().ok(expectedInformix)
.withMssql().ok(expectedMssql);
}

/** Test case for
Expand Down Expand Up @@ -669,9 +673,13 @@ private static RelNode sqlToRel(String sql, SchemaPlus defaultSchema,
+ "(SELECT DATE '2022-01-01' AS \"$f0\") AS \"t\"\nGROUP BY \"t\".\"$f0\"";
String expectedInformix = "SELECT AVG(employee.salary)\nFROM foodmart.employee,"
+ "\n(SELECT DATE '2022-01-01' AS $f0) AS t\nGROUP BY t.$f0";
String expectedMssql = "SELECT AVG([employee].[salary])\n"
+ "FROM [foodmart].[employee],\n"
+ "(VALUES ('2022-01-01')) AS [t] ([$f0])\nGROUP BY [t].[$f0]";
sql(query)
.withRedshift().ok(expectedRedshift)
.withInformix().ok(expectedInformix);
.withInformix().ok(expectedInformix)
.withMssql().ok(expectedMssql);
}

@Test void testSimpleSelectStarFromProductTable() {
Expand Down
Loading