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

create table as select should acquire X lock on target table

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0.0
    • Fix Version/s: None
    • Component/s: Transactions
    • Labels:
      None

      Description

      hive> create table test.dummy as select * from oraclehadoop.dummy;
      This acquires SHARED_READ on oraclehadoop.dummy table and SHARED_READ on test database.

      The effect is that you can drop test.dummy from another session while the insert is still in progress.

      This operation is a bit odd in that it combines a DDL operation which is not transactional with a DML operation which is.

      If it were to fail in the middle, the target table would remain. This can't be fixed easily but we should get an X lock on test.dummy.

      The workaround is to split this into 2 commands
      1. create table
      2. perform insert

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ekoifman Eugene Koifman
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: