Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-12676

[hive+impala] Alter table Rename to + Set location in a single step

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Assume a nonstandard table location, let's say /foo/bar/table1. You might want to rename from table1 to table2 and move the underlying data accordingly to /foo/bar/table2.

      The "alter table ... rename to ..." clause alters the table name, but in the same step moves the data into the standard location /user/hive/warehouse/table2. Then a subsequent "alter table ... set location ..." can move it back to the desired location /foo/bar/table2.

      This is problematic if there's any permission problem in the game, e.g. not being able to write to /user/hive/warehouse. So it should be possible to move the underlying data to its desired final place without intermittent places in between.

      A probably hard to discover workaround is to set the table to external, then rename it, then set back to internal and then change its location.

      It would be great to be able to do an "alter table ... rename to ... set location ..." operation in a single step.

      Attachments

        Activity

          People

            Unassigned Unassigned
            egmont@c Egmont Koblinger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: