GitHub user adrian-wang opened a pull request:
https://github.com/apache/spark/pull/4865
[SPARK-6130] [SQL] support if not exists for insert overwrite into
partition in hiveQl
Standard syntax:
INSERT OVERWRITE TABLE tablename1 [PARTITION (partcol1=val1, partcol2=val2
...) [IF NOT EXISTS]] select_statement1 FROM from_statement;
INSERT INTO TABLE tablename1 [PARTITION (partcol1=val1, partcol2=val2 ...)]
select_statement1 FROM from_statement;
Â
Hive extension (multiple inserts):
FROM from_statement
INSERT OVERWRITE TABLE tablename1 [PARTITION (partcol1=val1, partcol2=val2
...) [IF NOT EXISTS]] select_statement1
[INSERT OVERWRITE TABLE tablename2 [PARTITION ... [IF NOT EXISTS]]
select_statement2]
[INSERT INTO TABLE tablename2 [PARTITION ...] select_statement2] ...;
FROM from_statement
INSERT INTO TABLE tablename1 [PARTITION (partcol1=val1, partcol2=val2 ...)]
select_statement1
[INSERT INTO TABLE tablename2 [PARTITION ...] select_statement2]
[INSERT OVERWRITE TABLE tablename2 [PARTITION ... [IF NOT EXISTS]]
select_statement2] ...;
Â
Hive extension (dynamic partition inserts):
INSERT OVERWRITE TABLE tablename PARTITION (partcol1[=val1],
partcol2[=val2] ...) select_statement FROM from_statement;
INSERT INTO TABLE tablename PARTITION (partcol1[=val1], partcol2[=val2]
...) select_statement FROM from_statement;
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/adrian-wang/spark insertoverwrite
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/4865.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #4865
----
commit e252196659b02defda04adbd25e8b89eaa1fc506
Author: Daoyuan Wang <[email protected]>
Date: 2015-03-03T03:06:55Z
support if not exists for insert overwrite into partition in hiveQl
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]