You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/02/14 18:43:27 UTC

[GitHub] [spark] imback82 opened a new pull request #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

imback82 opened a new pull request #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584
 
 
   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   In ALTER TABLE, a column in ADD COLUMNS can depend on the position of a column that is just being added. For example, for a table with the following schema:
   ```
   root:
     - a: string
     - b: long
   ```
   , the following should work:
   ```
   ALTER TABLE t ADD COLUMNS (x int AFTER a, y int AFTER x) 
   ```
   Currently, the above statement will throw an exception saying that AFTER x cannot be resolved, because x doesn't exist yet. This PR proposes to fix this issue.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   To fix a bug described above.
   
   ### Does this PR introduce any user-facing change?
   <!--
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If no, write 'No'.
   -->
   Yes, now
   ```
   ALTER TABLE t ADD COLUMNS (x int AFTER a, y int AFTER x) 
   ```
   works as expected.
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   Added new tests

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#discussion_r380003308
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ##########
 @@ -3023,9 +3023,27 @@ class Analyzer(
   object ResolveAlterTableChanges extends Rule[LogicalPlan] {
     def apply(plan: LogicalPlan): LogicalPlan = plan.resolveOperatorsUp {
       case a @ AlterTable(_, _, t: NamedRelation, changes) if t.resolved =>
+        // Keeps track of new columns being added. Keys are normalized parent names and
+        // values are field names that belong to their parent.
 
 Review comment:
   Can we be more clear here? For example, if we add a column `a.b.c.d`, which part should be the key? `a.b.c` or `a.b`?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586472275
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23208/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586848586
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586538166
 
 
   **[Test build #118451 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118451/testReport)** for PR 27584 at commit [`cadda78`](https://github.com/apache/spark/commit/cadda78c1ea49f499a9253e12a840de76bf01c3d).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586523814
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118443/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586422390
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23200/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-587117544
 
 
   **[Test build #118599 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118599/testReport)** for PR 27584 at commit [`42d1c48`](https://github.com/apache/spark/commit/42d1c483b55e384b56660094fb4cbab1028d73ef).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586472271
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586871407
 
 
   **[Test build #118556 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118556/testReport)** for PR 27584 at commit [`34b1363`](https://github.com/apache/spark/commit/34b1363d9fe98c6a43d7f3b579b7024113f9d062).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586470946
 
 
   **[Test build #118451 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118451/testReport)** for PR 27584 at commit [`cadda78`](https://github.com/apache/spark/commit/cadda78c1ea49f499a9253e12a840de76bf01c3d).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586993429
 
 
   **[Test build #118556 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118556/testReport)** for PR 27584 at commit [`34b1363`](https://github.com/apache/spark/commit/34b1363d9fe98c6a43d7f3b579b7024113f9d062).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586868871
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-587186223
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586538472
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118451/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586848328
 
 
   **[Test build #118544 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118544/testReport)** for PR 27584 at commit [`34b1363`](https://github.com/apache/spark/commit/34b1363d9fe98c6a43d7f3b579b7024113f9d062).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-587185860
 
 
   **[Test build #118599 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118599/testReport)** for PR 27584 at commit [`42d1c48`](https://github.com/apache/spark/commit/42d1c483b55e384b56660094fb4cbab1028d73ef).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586422390
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23200/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586421298
 
 
   **[Test build #118443 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118443/testReport)** for PR 27584 at commit [`fd383b3`](https://github.com/apache/spark/commit/fd383b33faaee410f1a2e7e4fac54d33a887cca6).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586848586
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] brkyvz commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
brkyvz commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-587125462
 
 
   LGTM as well!

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586472271
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586864748
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118544/
   Test FAILed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586868881
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23308/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586523233
 
 
   **[Test build #118443 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118443/testReport)** for PR 27584 at commit [`fd383b3`](https://github.com/apache/spark/commit/fd383b33faaee410f1a2e7e4fac54d33a887cca6).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586871407
 
 
   **[Test build #118556 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118556/testReport)** for PR 27584 at commit [`34b1363`](https://github.com/apache/spark/commit/34b1363d9fe98c6a43d7f3b579b7024113f9d062).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586864079
 
 
   **[Test build #118544 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118544/testReport)** for PR 27584 at commit [`34b1363`](https://github.com/apache/spark/commit/34b1363d9fe98c6a43d7f3b579b7024113f9d062).
    * This patch **fails due to an unknown error code, -9**.
    * This patch merges cleanly.
    * This patch adds no public classes.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-587186227
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118599/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#discussion_r380020469
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
 ##########
 @@ -483,8 +484,16 @@ trait CheckAnalysis extends PredicateHelper {
                   checkColumnNotExists("add", add.fieldNames(), table.schema)
                 }
                 val parent = findParentStruct("add", add.fieldNames())
-                positionArgumentExists(add.position(), parent)
+                add.position match {
+                  case after: After =>
+                    // Handle the case where column position is referencing new columns being added.
+                    if (!colsToAdd.contains(add.fieldNames().init :+ after.column)) {
+                      positionArgumentExists(add.position(), parent)
 
 Review comment:
   shall we just add one more parameter to `positionArgumentExists` for the newly added columns?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] brkyvz edited a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
brkyvz edited a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-587125462
 
 
   LGTM as well! Thanks @imback82 for the quick fix :)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586995223
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586864736
 
 
   Merged build finished. Test FAILed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586864748
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118544/
   Test FAILed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan closed pull request #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586848595
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23299/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586538472
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118451/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586864736
 
 
   Merged build finished. Test FAILed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586995233
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118556/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586422380
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586868871
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-587186227
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118599/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586868226
 
 
   retest this please

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586523814
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118443/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586538469
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#discussion_r380020580
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
 ##########
 @@ -483,8 +484,16 @@ trait CheckAnalysis extends PredicateHelper {
                   checkColumnNotExists("add", add.fieldNames(), table.schema)
                 }
                 val parent = findParentStruct("add", add.fieldNames())
-                positionArgumentExists(add.position(), parent)
+                add.position match {
+                  case after: After =>
+                    // Handle the case where column position is referencing new columns being added.
+                    if (!colsToAdd.contains(add.fieldNames().init :+ after.column)) {
+                      positionArgumentExists(add.position(), parent)
 
 Review comment:
   just want to make sure all the caller side of `positionArgumentExists` take care of newly added columns.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586868881
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23308/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586848328
 
 
   **[Test build #118544 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118544/testReport)** for PR 27584 at commit [`34b1363`](https://github.com/apache/spark/commit/34b1363d9fe98c6a43d7f3b579b7024113f9d062).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-587117962
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23352/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-587117962
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23352/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-587279776
 
 
   thanks, merging to master/3.0!

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586538469
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-587117544
 
 
   **[Test build #118599 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118599/testReport)** for PR 27584 at commit [`42d1c48`](https://github.com/apache/spark/commit/42d1c483b55e384b56660094fb4cbab1028d73ef).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586422380
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586472275
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23208/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-587117948
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586523807
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-587186223
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] imback82 commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
imback82 commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586439593
 
 
   cc @brkyvz @cloud-fan 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586848595
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23299/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586421298
 
 
   **[Test build #118443 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118443/testReport)** for PR 27584 at commit [`fd383b3`](https://github.com/apache/spark/commit/fd383b33faaee410f1a2e7e4fac54d33a887cca6).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-587117948
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586995233
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118556/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586470946
 
 
   **[Test build #118451 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118451/testReport)** for PR 27584 at commit [`cadda78`](https://github.com/apache/spark/commit/cadda78c1ea49f499a9253e12a840de76bf01c3d).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586523807
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27584: [SPARK-30814][SQL] ALTER TABLE ... ADD COLUMN position should be able to reference columns being added 
URL: https://github.com/apache/spark/pull/27584#issuecomment-586995223
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org