Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In Hive 0.70 or later, DROP returns an error if the partition doesn't exist, unless IF EXISTS is specified or the configuration variable hive.exec.drop.ignorenonexistent is set to true.

For tables that are protected by NO DROP CASCADE, you can use the predicate IGNORE PROTECTION to drop a specified partition or set of partitions (for example, when splitting a table between two Hadoop clusters).

Code Block

ALTER TABLE table_name DROP [IF EXISTS] partition_spec IGNORE PROTECTION

The above command will drop that partition regardless of protection stats.

Code Block
ALTER TABLE page_view DROP PARTITION (dt='2008-08-08', country='us');

...