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

Create read-only transactions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.0
    • 4.0.0-alpha-1
    • Transactions
    • None

    Description

      With HIVE-21036 we have a way to indicate that a txn is read only.
      We should (at least in auto-commit mode) determine if the single stmt is a read and mark the txn accordingly.
      Then we can optimize TxnHandler.commitTxn() so that it doesn't do any checks in write_set etc.

      TxnHandler.commitTxn() already starts with lockTransactionRecord(stmt, txnid, TXN_OPEN) so it can read the txn type in the same SQL stmt.

      HiveOperation only has QUERY, which includes Insert and Select, so this requires figuring out how to determine if a query is a SELECT. By the time Driver.openTransaction(); is called, we have already parsed the query so there should be a way to know if the statement only reads.

      For multi-stmt txns (once these are supported) we should allow user to indicate that a txn is read-only and then not allow any statements that can make modifications in this txn. This should be a different jira.

      cc ikryvenko

      Attachments

        1. HIVE-21114.1.patch
          16 kB
          Denys Kuzmenko
        2. HIVE-21114.10.patch
          38 kB
          Denys Kuzmenko
        3. HIVE-21114.11.patch
          38 kB
          Denys Kuzmenko
        4. HIVE-21114.2.patch
          16 kB
          Denys Kuzmenko
        5. HIVE-21114.3.patch
          17 kB
          Denys Kuzmenko
        6. HIVE-21114.4.patch
          17 kB
          Denys Kuzmenko
        7. HIVE-21114.5.patch
          20 kB
          Denys Kuzmenko
        8. HIVE-21114.6.patch
          25 kB
          Denys Kuzmenko
        9. HIVE-21114.7.patch
          25 kB
          Denys Kuzmenko
        10. HIVE-21114.8.patch
          33 kB
          Denys Kuzmenko
        11. HIVE-21114.9.patch
          35 kB
          Denys Kuzmenko

        Issue Links

          Activity

            People

              dkuzmenko Denys Kuzmenko
              ekoifman Eugene Koifman
              Votes:
              0 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: