spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Spark (JIRA)" <>
Subject [jira] [Commented] (SPARK-20845) Support specification of column names in INSERT INTO
Date Sun, 23 Sep 2018 21:00:00 GMT


Apache Spark commented on SPARK-20845:

User 'misutoth' has created a pull request for this issue:

> Support specification of column names in INSERT INTO
> ----------------------------------------------------
>                 Key: SPARK-20845
>                 URL:
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.0.0
>            Reporter: Josh Rosen
>            Priority: Minor
> Some databases allow you to specify column names when specifying the target of an INSERT
INTO. For example, in SQLite:
> {code}
> sqlite> CREATE TABLE twocolumn (x INT, y INT); INSERT INTO twocolumn(x, y) VALUES
(44,51), (NULL,52), (42,53), (45,45)
>    ...> ;
> sqlite> select * from twocolumn;
> 44|51
> |52
> 42|53
> 45|45
> {code}
> I have a corpus of existing queries of this form which I would like to run on Spark SQL,
so I think we should extend our dialect to support this syntax.
> When implementing this, we should make sure to test the following behaviors and corner-cases:
> - Number of columns specified is greater than or less than the number of columns in the
> - Specification of repeated columns.
> - Specification of columns which do not exist in the target table.
> - Permute column order instead of using the default order in the table.
> For each of these, we should check how SQLite behaves and should also compare against
another database. It looks like T-SQL supports this; see
under the "Inserting data that is not in the same order as the table columns" header.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message