whuGuo commented on a change in pull request #1664:
URL: https://github.com/apache/calcite/pull/1664#discussion_r773717100
##########
File path:
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
##########
@@ -5972,7 +5972,9 @@ protected SqlNode visitScoped(SqlCall call) {
int n = 0;
for (SqlNode s : select.getSelectList()) {
final String alias = SqlValidatorUtil.getAlias(s, -1);
- if (alias != null && nameMatcher.matches(alias, name)) {
+ if (alias != null && nameMatcher.matches(alias, name)
+ && s instanceof SqlBasicCall //only "expr as alias" need expand,
but A as A no need
+ && !s.hasUnderlyingColumnSameAsAlias(alias)) {
expr = s;
Review comment:
done
##########
File path: core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
##########
@@ -8723,6 +8723,61 @@ public void subTestIntervalSecondFailsValidation() {
sql(sql3).ok(expected3);
}
+ @Test public void testGroupByAlias1() {
+ conformance = SqlConformanceEnum.LENIENT;
+ final String sql = "select price,price\n"
Review comment:
done
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]