jinxing64 commented on a change in pull request #1664: [CALCITE-3589]
SqlValidatorException when conformation is set to LENIENT
URL: https://github.com/apache/calcite/pull/1664#discussion_r358634675
##########
File path: core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
##########
@@ -11236,6 +11236,35 @@ private void checkCustomColumnResolving(String table)
{
assertThat(resultType.toString(), is("INTEGER"));
}
+ @Test public void testGroupByAlias() {
+ // test group by alias, when the underlying column in the expression is
the same as the alias
+ sql("select DEPTNO+1 as DEPTNO from emp group by DEPTNO+1")
+ .withConformance(SqlConformanceEnum.LENIENT)
+ .ok();
Review comment:
As discussed from JIRA:
1. All projection fields must either be in the groupping columns or in the
agg functions
2. Property of `isGroupByAlias` in LENIENT conformance is true.
In my understanding, this Sql should not pass the validation.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services