You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (Jira)" <ji...@apache.org> on 2020/02/04 19:44:00 UTC

[jira] [Updated] (SPARK-30685) Support ANSI INSERT syntax

     [ https://issues.apache.org/jira/browse/SPARK-30685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dongjoon Hyun updated SPARK-30685:
----------------------------------
    Affects Version/s:     (was: 3.0.0)
                       3.1.0

> Support ANSI INSERT syntax
> --------------------------
>
>                 Key: SPARK-30685
>                 URL: https://issues.apache.org/jira/browse/SPARK-30685
>             Project: Spark
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 3.1.0
>            Reporter: Chris Knoll
>            Priority: Minor
>
> Related to the [ANSI SQL specification for insert syntax](https://en.wikipedia.org/wiki/Insert_(SQL)), could the parsing and underlying engine support the syntax of:
> {{INSERT INTO <table> (<column list>) select <columns list) from <otherTable>}}
> I think I read somewhere that there's some underlying technical detail where the columns inserted into SPARK tables must have the selected columns match the order of the table definition.  But, if this is the case, isn't' there a place in the parser-layer and execution-layer where the parser can translate something like:
> {{insert into someTable (col1,col2)
> select someCol1, someCol2 from otherTable}}
> Where someTable has 3 columns (col3,col2,col1) (note the order here), the query is rewritten and sent to the engine as:
> {{insert into someTable
> select null, someCol2, someCol1 from otherTable}}
> Note, the reordering and adding of the null column was done based on some table metadata on someTable so it knew which columns from the INSERT() map over to the columns from the select.
> Is this possible? The lack of specifying column values is preventing our project from SPARK being a supported platform.



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

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