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

SELECT max(bar) FROM foo is broken after ANALYZE ... FOR COLUMNS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.14.0, 1.0.0, 1.1.0
    • 1.2.0
    • Beeline, Logical Optimizer
    • None

    Description

      These queries produce an error :

      DROP TABLE IF EXISTS foo;
      
      CREATE TABLE foo (id int) STORED AS ORC;
      
      INSERT INTO TABLE foo VALUES (1);
      INSERT INTO TABLE foo VALUES (2);
      INSERT INTO TABLE foo VALUES (3);
      INSERT INTO TABLE foo VALUES (4);
      INSERT INTO TABLE foo VALUES (5);
      
      SELECT max(id) FROM foo;
      
      ANALYZE TABLE foo COMPUTE STATISTICS FOR COLUMNS id;
      
      SELECT max(id) FROM foo;
      

      The last query throws org.apache.hive.service.cli.HiveSQLException

      0: jdbc:hive2://nc-h04:10000/casino> SELECT max(id) FROM foo;
      +-------------+--+
      |     _c0     |
      +-------------+--+
      org.apache.hive.service.cli.HiveSQLException: java.lang.ClassCastException
      0: jdbc:hive2://nc-h04:10000/casino>
      

      Attachments

        1. HIVE-9397.1.patch.txt
          10 kB
          Navis Ryu
        2. HIVE-9397.2.patch.txt
          18 kB
          Navis Ryu
        3. HIVE-9397.3.patch.txt
          27 kB
          Navis Ryu

        Issue Links

          Activity

            People

              Maikl Maikl
              damien.carol Damien Carol
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: