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

Hive ACID Data Corruption: Update command mess the other column data and produces incorrect result

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: None
    • Component/s: Hive, Transactions
    • Labels:
      None

      Description

      Hive Update Operation update the other column incorrectly and produces incorrect results:

      Steps to reproduce:

      CREATE TABLE `test`(
        `start_dt` timestamp, 
        `stop_dt` timestamp
        );
        
      INSERT INTO test (start_dt, stop_dt) SELECT  CURRENT_TIMESTAMP, CAST(NULL AS TIMESTAMP);
      
      select * from test; 
      +--------------------------+---------------+
      |      test.start_dt       | test.stop_dt  |
      +--------------------------+---------------+
      | 2020-02-28 20:06:29.116  | NULL          |
      +--------------------------+---------------+
      
      UPDATE test SET STOP_DT = CURRENT_TIMESTAMP WHERE CAST(START_DT AS DATE) = CURRENT_DATE;
      
      +------------------------+--------------------------+
      |     test.start_dt      |       test.stop_dt       |
      +------------------------+--------------------------+
      | 2020-02-28 00:00:00.0  | 2020-02-28 20:07:12.248  |
      +------------------------+--------------------------+
      

        Attachments

        1. HIVE-22945.1.patch
          6 kB
          Denys Kuzmenko
        2. HIVE-22945.2.patch
          6 kB
          Denys Kuzmenko

          Issue Links

            Activity

              People

              • Assignee:
                dkuzmenko Denys Kuzmenko
                Reporter:
                Rajkumar Singh Rajkumar Singh
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: