Burak Yavuz created SPARK-30814:
-----------------------------------

             Summary: Add Columns references should be able to resolve each 
other
                 Key: SPARK-30814
                 URL: https://issues.apache.org/jira/browse/SPARK-30814
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: Burak Yavuz


In ResolveAlterTableChanges, we have checks that make sure that positional 
arguments exist and are normalized around case sensitivity for ALTER TABLE ADD 
COLUMNS. However, we missed the case, where a column in ADD COLUMNS can depend 
on the position of a column that is just being added.

For example for the schema:
{code:java}
root:
  - a: string
  - b: long
 {code}
 

The following should work:
{code:java}
ALTER TABLE ... ADD COLUMNS (x int AFTER a, y int AFTER x) {code}
Currently, the above statement will throw an error saying that AFTER x cannot 
be resolved, because x doesn't exist yet.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to