NobiGo commented on code in PR #4289:
URL: https://github.com/apache/calcite/pull/4289#discussion_r2038526107


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java:
##########
@@ -102,6 +102,28 @@ public interface SqlConformance {
    */
   boolean isGroupByAlias();
 
+  /**
+   * Value describing how to perform lookup for values defined in a SELECT 
statement.
+   */
+  enum SelectAliasLookup {
+    /** Values defined in a SELECT statement are not visible within the 
statement. */
+    UNSUPPORTED,
+    /** Values defined in a SELECT statement are visible to the right of their 
definition. */
+    LEFT_TO_RIGHT,

Review Comment:
   ```
   What if the table t already has a column called “a” ?
   Should “b” be 42 + 1, or should it be the column “a” + 1 ?
   ```
   In Spark:
   ```
   select 2 as x, x + 2 from table;
   ```
   When the table has column x. and value 1. The SQL will return `2   3`.
   I'm not sure if any other databases return `2 4` means the priority of 
column aliases is higher than the definition of the table. 



-- 
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]

Reply via email to