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

Temp tables shouldn't be locked

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 1.3.0, 2.1.0
    • Transactions
    • None

    Description

      Internally, INSERT INTO ... VALUES statements use temp table to accomplish its functionality. But temp tables shouldn't be stored in the metastore tables for ACID, because they are by definition only visible inside the session that created them, and we don't allow multiple threads inside a session. If a temp table is used in a query, it should be ignored by lock manager.

      mysql> select * from COMPLETED_TXN_COMPONENTS;
      +-----------+--------------+-----------------------+------------------+
      | CTC_TXNID | CTC_DATABASE | CTC_TABLE             | CTC_PARTITION    |
      +-----------+--------------+-----------------------+------------------+
      |         1 | acid         | t1                    | NULL             |
      |         1 | acid         | values__tmp__table__1 | NULL             |
      |         2 | acid         | t1                    | NULL             |
      |         2 | acid         | values__tmp__table__2 | NULL             |
      |         3 | acid         | values__tmp__table__3 | NULL             |
      |         3 | acid         | t1                    | NULL             |
      |         4 | acid         | values__tmp__table__1 | NULL             |
      |         4 | acid         | t2p                   | ds=today         |
      |         5 | acid         | values__tmp__table__1 | NULL             |
      |         5 | acid         | t3p                   | ds=today/hour=12 |
      +-----------+--------------+-----------------------+------------------+
      

      Attachments

        1. HIVE-12996.1.patch
          8 kB
          Wei Zheng
        2. HIVE-12996.2.patch
          8 kB
          Wei Zheng
        3. HIVE-12996.3.patch
          7 kB
          Wei Zheng

        Issue Links

          Activity

            People

              wzheng Wei Zheng
              wzheng Wei Zheng
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: