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

Stale results when executing queries over recreated transactional tables

    XMLWordPrintableJSON

Details

    Description

      SQL queries return stale results from the cache when the tables involved in the queries are dropped and then recreated with the same name.

      The problem can be reproduced by executing the following sequence of queries.

      CREATE TABLE author (fname STRING) STORED AS ORC TBLPROPERTIES('transactional'='true');
      INSERT INTO author VALUES ('Victor');
      SELECT fname FROM author;
      
      DROP TABLE author;
      
      CREATE TABLE author (fname STRING) STORED AS ORC TBLPROPERTIES('transactional'='true');
      INSERT INTO author VALUES ('Alexander');
      SELECT fname FROM author;
      

      The first execution of the SELECT query correctly returns "Victor" as a result.
      The second execution of the SELECT query incorrectly returns "Victor" while it should return "Alexander".

      The problem manifestates only when the hive.query.results.cache.enabled is set to true.

      Attachments

        1. results_cache_invalidation3.q
          0.6 kB
          Stamatis Zampetakis

        Issue Links

          Activity

            People

              ximz Xiaomin Zhang
              zabetak Stamatis Zampetakis
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: