FAQ
ALTER TABLE ADD PARTITION needs IF NOT EXISTS.
----------------------------------------------

Key: HIVE-2826
URL: https://issues.apache.org/jira/browse/HIVE-2826
Project: Hive
Issue Type: Improvement
Reporter: Adam Kramer


When trying to add a partition, if the partition already exists, we shouldn't necessarily cause the job to fail...just like we have CREATE TABLE IF NOT EXISTS and DROP TABLE IF EXISTS, we should have ALTER TABLE foo ADD PARTITION IF NOT EXISTS (ds=whatever).

Ditto for ALTER VIEW.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

Search Discussions

  • Carl Steinbach (Updated) (JIRA) at Apr 9, 2012 at 8:35 pm
    [ https://issues.apache.org/jira/browse/HIVE-2826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Carl Steinbach updated HIVE-2826:
    ---------------------------------

    Description:
    Support for ALTER TABLE x ADD IF NOT EXISTS PARTITION was added in HIVE-1106. The same semantics should be supported for ALTER VIEW.

    WAS:
    When trying to add a partition, if the partition already exists, we shouldn't necessarily cause the job to fail...just like we have CREATE TABLE IF NOT EXISTS and DROP TABLE IF EXISTS, we should have ALTER TABLE foo ADD PARTITION IF NOT EXISTS (ds=whatever).

    Ditto for ALTER VIEW.

    was:
    When trying to add a partition, if the partition already exists, we shouldn't necessarily cause the job to fail...just like we have CREATE TABLE IF NOT EXISTS and DROP TABLE IF EXISTS, we should have ALTER TABLE foo ADD PARTITION IF NOT EXISTS (ds=whatever).

    Ditto for ALTER VIEW.

    Summary: ALTER VIEW ADD PARTITION needs IF NOT EXISTS. (was: ALTER TABLE ADD PARTITION needs IF NOT EXISTS.)
    ALTER VIEW ADD PARTITION needs IF NOT EXISTS.
    ---------------------------------------------

    Key: HIVE-2826
    URL: https://issues.apache.org/jira/browse/HIVE-2826
    Project: Hive
    Issue Type: Improvement
    Reporter: Adam Kramer

    Support for ALTER TABLE x ADD IF NOT EXISTS PARTITION was added in HIVE-1106. The same semantics should be supported for ALTER VIEW.
    WAS:
    When trying to add a partition, if the partition already exists, we shouldn't necessarily cause the job to fail...just like we have CREATE TABLE IF NOT EXISTS and DROP TABLE IF EXISTS, we should have ALTER TABLE foo ADD PARTITION IF NOT EXISTS (ds=whatever).
    Ditto for ALTER VIEW.
    --
    This message is automatically generated by JIRA.
    If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
    For more information on JIRA, see: http://www.atlassian.com/software/jira
  • Adam Kramer (Commented) (JIRA) at Apr 10, 2012 at 8:00 am
    [ https://issues.apache.org/jira/browse/HIVE-2826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13250498#comment-13250498 ]

    Adam Kramer commented on HIVE-2826:
    -----------------------------------

    Ugh, sorry. The weird difference in syntax is what made me think this had not been implemented.
    ALTER VIEW ADD PARTITION needs IF NOT EXISTS.
    ---------------------------------------------

    Key: HIVE-2826
    URL: https://issues.apache.org/jira/browse/HIVE-2826
    Project: Hive
    Issue Type: Improvement
    Reporter: Adam Kramer

    Support for ALTER TABLE x ADD IF NOT EXISTS PARTITION was added in HIVE-1106. The same semantics should be supported for ALTER VIEW.
    WAS:
    When trying to add a partition, if the partition already exists, we shouldn't necessarily cause the job to fail...just like we have CREATE TABLE IF NOT EXISTS and DROP TABLE IF EXISTS, we should have ALTER TABLE foo ADD PARTITION IF NOT EXISTS (ds=whatever).
    Ditto for ALTER VIEW.
    --
    This message is automatically generated by JIRA.
    If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
    For more information on JIRA, see: http://www.atlassian.com/software/jira
  • Adam Kramer (Commented) (JIRA) at Apr 10, 2012 at 8:02 am
    [ https://issues.apache.org/jira/browse/HIVE-2826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13250499#comment-13250499 ]

    Adam Kramer commented on HIVE-2826:
    -----------------------------------

    Also, it is implemented for views, too.
    ALTER VIEW ADD PARTITION needs IF NOT EXISTS.
    ---------------------------------------------

    Key: HIVE-2826
    URL: https://issues.apache.org/jira/browse/HIVE-2826
    Project: Hive
    Issue Type: Improvement
    Reporter: Adam Kramer

    Support for ALTER TABLE x ADD IF NOT EXISTS PARTITION was added in HIVE-1106. The same semantics should be supported for ALTER VIEW.
    WAS:
    When trying to add a partition, if the partition already exists, we shouldn't necessarily cause the job to fail...just like we have CREATE TABLE IF NOT EXISTS and DROP TABLE IF EXISTS, we should have ALTER TABLE foo ADD PARTITION IF NOT EXISTS (ds=whatever).
    Ditto for ALTER VIEW.
    --
    This message is automatically generated by JIRA.
    If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
    For more information on JIRA, see: http://www.atlassian.com/software/jira
  • Adam Kramer (Updated) (JIRA) at Apr 10, 2012 at 8:04 am
    [ https://issues.apache.org/jira/browse/HIVE-2826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Adam Kramer updated HIVE-2826:
    ------------------------------

    Priority: Minor (was: Major)
    ALTER VIEW ADD (IF NOT EXISTS) PARTITION syntax is bad.
    -------------------------------------------------------

    Key: HIVE-2826
    URL: https://issues.apache.org/jira/browse/HIVE-2826
    Project: Hive
    Issue Type: Improvement
    Reporter: Adam Kramer
    Priority: Minor

    The syntax, ALTER TABLE x ADD IF NOT EXISTS PARTITION, puts the "IF NOT EXISTS" before the subject of the statement. Not only is this weird grammar, but it is also inconsistent with other uses of "IF NOT EXISTS", for example, "CREATE TABLE IF NOT EXISTS" and "DROP TABLE IF EXISTS".
    It would be a minor improvement to align the syntaxes.
    --
    This message is automatically generated by JIRA.
    If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
    For more information on JIRA, see: http://www.atlassian.com/software/jira
  • Adam Kramer (Updated) (JIRA) at Apr 10, 2012 at 8:04 am
    [ https://issues.apache.org/jira/browse/HIVE-2826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Adam Kramer updated HIVE-2826:
    ------------------------------

    Description:
    The syntax, ALTER TABLE x ADD IF NOT EXISTS PARTITION, puts the "IF NOT EXISTS" before the subject of the statement. Not only is this weird grammar, but it is also inconsistent with other uses of "IF NOT EXISTS", for example, "CREATE TABLE IF NOT EXISTS" and "DROP TABLE IF EXISTS".

    It would be a minor improvement to align the syntaxes.


    was:
    Support for ALTER TABLE x ADD IF NOT EXISTS PARTITION was added in HIVE-1106. The same semantics should be supported for ALTER VIEW.

    WAS:
    When trying to add a partition, if the partition already exists, we shouldn't necessarily cause the job to fail...just like we have CREATE TABLE IF NOT EXISTS and DROP TABLE IF EXISTS, we should have ALTER TABLE foo ADD PARTITION IF NOT EXISTS (ds=whatever).

    Ditto for ALTER VIEW.

    Summary: ALTER VIEW ADD (IF NOT EXISTS) PARTITION syntax is bad. (was: ALTER VIEW ADD PARTITION needs IF NOT EXISTS.)
    ALTER VIEW ADD (IF NOT EXISTS) PARTITION syntax is bad.
    -------------------------------------------------------

    Key: HIVE-2826
    URL: https://issues.apache.org/jira/browse/HIVE-2826
    Project: Hive
    Issue Type: Improvement
    Reporter: Adam Kramer

    The syntax, ALTER TABLE x ADD IF NOT EXISTS PARTITION, puts the "IF NOT EXISTS" before the subject of the statement. Not only is this weird grammar, but it is also inconsistent with other uses of "IF NOT EXISTS", for example, "CREATE TABLE IF NOT EXISTS" and "DROP TABLE IF EXISTS".
    It would be a minor improvement to align the syntaxes.
    --
    This message is automatically generated by JIRA.
    If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
    For more information on JIRA, see: http://www.atlassian.com/software/jira

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categorieshive, hadoop
postedFeb 27, '12 at 6:21a
activeApr 10, '12 at 8:04a
posts6
users1
websitehive.apache.org

1 user in discussion

Adam Kramer (Updated) (JIRA): 6 posts

People

Translate

site design / logo © 2022 Grokbase