carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "wyp (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CARBONDATA-1595) Support static and dynamic partition in insert into/overwrite DML
Date Thu, 19 Oct 2017 05:56:00 GMT

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

wyp updated CARBONDATA-1595:
----------------------------
    Description: 
In [CARBONDATA-910|https://issues.apache.org/jira/browse/CARBONDATA-910]  carbondata implement
partition feature, it's very useful. But if we want to add partition data in carbondata table,we
must be use {{alter}} syntax as following:
{code}
carbon.sql("ALTER TABLE temp.test_table ADD PARTITION('2017-10-18', '2017-10-19')")
{code}
If you have many partitions that should be add to some table, you should run the sql many
times, It's boring and inefficiency. So it's very useful to support static and dynamic partition
 in insert into/overwrite DML:
{code}
Static partition:
INSERT OVERWRITE TABLE tablename1 [PARTITION (partcol1=val1) [IF NOT EXISTS]] select_statement1
FROM from_statement;
INSERT INTO TABLE tablename1 [PARTITION (partcol1=val1)] select_statement1 FROM from_statement;

Dynamic partition:
INSERT OVERWRITE TABLE tablename1 [PARTITION (partcol1) [IF NOT EXISTS]] select_statement1
FROM from_statement;
INSERT INTO TABLE tablename1 [PARTITION (partcol1)] select_statement1 FROM from_statement;
{code}

  was:
In [CARBONDATA-910|https://issues.apache.org/jira/browse/CARBONDATA-910]  carbondata implement
partition feature, it's very useful. But if we want to add partition data in carbondata table,we
must be use {{ alter}} syntax as following:
{code}
carbon.sql("ALTER TABLE temp.test_table ADD PARTITION('2017-10-18', '2017-10-19')")
{code}
If you have many partitions that should be add to some table, you should run the sql many
times, It's boring and inefficiency. So it;s very useful to support static and partition dynamic
in insert into/overwrite DML:
{code}
Static partition:
INSERT OVERWRITE TABLE tablename1 [PARTITION (partcol1=val1) [IF NOT EXISTS]] select_statement1
FROM from_statement;
INSERT INTO TABLE tablename1 [PARTITION (partcol1=val1)] select_statement1 FROM from_statement;

Dynamic partition:
INSERT OVERWRITE TABLE tablename1 [PARTITION (partcol1) [IF NOT EXISTS]] select_statement1
FROM from_statement;
INSERT INTO TABLE tablename1 [PARTITION (partcol1)] select_statement1 FROM from_statement;
{code}


> Support static and dynamic partition  in insert into/overwrite DML
> ------------------------------------------------------------------
>
>                 Key: CARBONDATA-1595
>                 URL: https://issues.apache.org/jira/browse/CARBONDATA-1595
>             Project: CarbonData
>          Issue Type: Sub-task
>          Components: sql
>    Affects Versions: 1.2.0
>            Reporter: wyp
>
> In [CARBONDATA-910|https://issues.apache.org/jira/browse/CARBONDATA-910]  carbondata
implement partition feature, it's very useful. But if we want to add partition data in carbondata
table,we must be use {{alter}} syntax as following:
> {code}
> carbon.sql("ALTER TABLE temp.test_table ADD PARTITION('2017-10-18', '2017-10-19')")
> {code}
> If you have many partitions that should be add to some table, you should run the sql
many times, It's boring and inefficiency. So it's very useful to support static and dynamic
partition  in insert into/overwrite DML:
> {code}
> Static partition:
> INSERT OVERWRITE TABLE tablename1 [PARTITION (partcol1=val1) [IF NOT EXISTS]] select_statement1
FROM from_statement;
> INSERT INTO TABLE tablename1 [PARTITION (partcol1=val1)] select_statement1 FROM from_statement;
> Dynamic partition:
> INSERT OVERWRITE TABLE tablename1 [PARTITION (partcol1) [IF NOT EXISTS]] select_statement1
FROM from_statement;
> INSERT INTO TABLE tablename1 [PARTITION (partcol1)] select_statement1 FROM from_statement;
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message