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:24: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 to specify target table columns in static partition insert.
As a result SQL parser will throw an error if fields from sub select does not match target
table fields.

For example for the following table

CREATE TABLE my_table(col1 STRING, col2 STRING, col3 STRING) PARTITIONED BY (pcol STRING);

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

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

Proposed change adds support for the following syntax:

INSERT OVERWRITE TABLE my_table
PARTITION(pcol='TEST')
*(col1, col3)*
SELECT 'A' as a, 'B'as b;



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

For example for the following table

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:

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

Proposed change adds support for the following syntax:

INSERT OVERWRITE TABLE my_table
PARTITION(pcol='TEST')
*(col1, col3)*
SELECT 'A' as a, 'B'as b;




> 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 to specify target table columns in static partition insert.
> As a result SQL parser will throw an error if fields from sub select does not match target
table fields.
> For example for the following table
> CREATE TABLE my_table(col1 STRING, col2 STRING, col3 STRING) PARTITIONED BY (pcol STRING);
> following insert will failed due to different number of fields in select and in target
table:
> INSERT OVERWRITE TABLE my_table
> PARTITION(pcol='TEST')
> SELECT 'A' as a, 'B'as b;
> Proposed change adds support for the following syntax:
> INSERT OVERWRITE TABLE my_table
> PARTITION(pcol='TEST')
> *(col1, col3)*
> SELECT 'A' as a, 'B'as b;



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

Mime
View raw message