[
https://issues.apache.org/jira/browse/SPARK-16037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15340257#comment-15340257
]
Ryan Blue commented on SPARK-16037:
-----------------------------------
I agree that this behavior is correct according to SQL, but I don't think it is
an expected behavior. Should we insert a warning when explicit column names are
added, match the destination table, and will be ignored?
> use by-position resolution when insert into hive table
> ------------------------------------------------------
>
> Key: SPARK-16037
> URL: https://issues.apache.org/jira/browse/SPARK-16037
> Project: Spark
> Issue Type: Sub-task
> Components: SQL
> Affects Versions: 2.0.0
> Reporter: Wenchen Fan
> Assignee: Wenchen Fan
> Fix For: 2.0.0
>
>
> INSERT INTO TABLE src SELECT 1, 2 AS c, 3 AS b;
> The result is 1, 3, 2 for hive table, which is wrong.
> Postgres ignores the column names when performing the equivalent query
> (without partitioning):
> {code:title=psql (9.3.13)}
> postgres=# create table src (a int, b int, c int);
> CREATE TABLE
> postgres=# insert into src select 1, 2 as c, 3 as b;
> INSERT 0 1
> postgres=# select * from src;
> a | b | c
> ---+---+---
> 1 | 2 | 3
> (1 row)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]