hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Hadoop Wiki] Update of "Hive/LanguageManual/DDL" by MichaelLewis
Date Wed, 13 Oct 2010 21:44:32 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.

The "Hive/LanguageManual/DDL" page has been changed by MichaelLewis.
The comment on this change is: It appears that IF NOT EXISTS is an undocumented feature of
add partition, and actually quite useful..
http://wiki.apache.org/hadoop/Hive/LanguageManual/DDL?action=diff&rev1=71&rev2=72

--------------------------------------------------

  
  === Add Partitions ===
  {{{
- ALTER TABLE table_name ADD partition_spec [ LOCATION 'location1' ] partition_spec [ LOCATION
'location2' ] ...
+ ALTER TABLE table_name ADD [IF NOT EXISTS] partition_spec [ LOCATION 'location1' ] partition_spec
[ LOCATION 'location2' ] ...
  
  partition_spec:
    : PARTITION (partition_col = partition_col_value, partition_col = partiton_col_value,
...)
@@ -187, +187 @@

  {{{
  ALTER TABLE page_view ADD PARTITION (dt='2008-08-08', country='us') location '/path/to/us/part080808'
PARTITION (dt='2008-08-09', country='us') location '/path/to/us/part080809';
  }}}
+ 
+ An error is thrown if the partition_spec for the table already exists. You can use IF NOT
EXISTS to skip the error.
+ 
  === Drop Partitions ===
  {{{
  ALTER TABLE table_name DROP partition_spec, partition_spec,...

Mime
View raw message