[
https://issues.apache.org/jira/browse/SPARK-16037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15340305#comment-15340305
]
Ryan Blue commented on SPARK-16037:
-----------------------------------
I agree, but I don't think this addresses the problem where the user expects
the result of the original query to be (1,3,2) and not (1,2,3). This isn't a
blocker, but a warning would be nice: "WARN: INSERT columns are matched by
position, ignoring names from expressions: 2 as c, 3 as b".
> 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]