hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kostyantyn Oliynyk (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-16300) Allow specify target table columns in static partition insert
Date Sun, 26 Mar 2017 21:22:41 GMT

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

Kostyantyn Oliynyk updated HIVE-16300:
--------------------------------------
    Description: 
It is not possible specify target table columns in static partition insert.
SQL parser will throw an error if fields from sub select does not match target table fields.

For example for the following table

{code}
CREATE TABLE my_table(col1 STRING, col2 STRING, col3 STRING) PARTITIONED BY (pool STRING);


following insert will failed due to different number of fields in select and in target table:

{code} 
INSERT OVERWRITE TABLE my_table
PARTITION(pcol='TEST')
SELECT 'A' as a, 'B'as b;
{code}

Proposed change adds support for the following syntax:
{code} 
INSERT OVERWRITE TABLE my_table
PARTITION(pcol='TEST')
*(col1, col3)*
SELECT 'A' as a, 'B'as b;
{code}


  was:
It is not possible specify target table columns in static partition insert.
SQL parser will throw an error if fields from sub select does not match target table fields.

For example for the following table

{code}
CREATE TABLE my_table(col1 STRING, col2 STRING, col3 STRING) PARTITIONED BY (pool STRING);
{code)

following insert will failed due to different number of fields in select and in target table:

{code} 
INSERT OVERWRITE TABLE my_table
PARTITION(pcol='TEST')
SELECT 'A' as a, 'B'as b;
{code}

Proposed change adds support for the following syntax:
{code} 
INSERT OVERWRITE TABLE my_table
PARTITION(pcol='TEST')
*(col1, col3)*
SELECT 'A' as a, 'B'as b;
{code}



> Allow specify target table columns in static partition insert
> -------------------------------------------------------------
>
>                 Key: HIVE-16300
>                 URL: https://issues.apache.org/jira/browse/HIVE-16300
>             Project: Hive
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.1.1
>            Reporter: Kostyantyn Oliynyk
>            Priority: Trivial
>
> It is not possible specify target table columns in static partition insert.
> SQL parser will throw an error if fields from sub select does not match target table
fields.
> For example for the following table
> {code}
> CREATE TABLE my_table(col1 STRING, col2 STRING, col3 STRING) PARTITIONED BY (pool STRING);
> following insert will failed due to different number of fields in select and in target
table:
> {code} 
> INSERT OVERWRITE TABLE my_table
> PARTITION(pcol='TEST')
> SELECT 'A' as a, 'B'as b;
> {code}
> Proposed change adds support for the following syntax:
> {code} 
> INSERT OVERWRITE TABLE my_table
> PARTITION(pcol='TEST')
> *(col1, col3)*
> SELECT 'A' as a, 'B'as b;
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message