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

create table as select should acquire X lock on target table

Log workAgile BoardRank to TopRank to BottomAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          $i18n.getText('security.level.explanation', $currentSelection) Viewable by All Users
          Cancel

            People

            • Assignee:
              Unassigned Assign to me
              Reporter:
              ekoifman Eugene Koifman

              Dates

              • Created:
                Updated:

                Issue deployment