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

When CBO is enable, CAST(STR as Bigint)IS NOT NULL result is wrong

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.1.0, 3.1.2
    • 4.0.0-alpha-2
    • CBO
    • None

    Description

      create  database testdb;
      CREATE TABLE IF NOT EXISTS testdb.z_tab 
      ( 
          SEARCHWORD    STRING, 
          COUNT_NUM     BIGINT, 
          WORDS         STRING 
      ) 
      ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' 
      STORED AS TEXTFILE;
      insert into table testdb.z_tab values('hivetest',111,'aaa'),('hivetest2',111,'bbb');
      
      set hive.cbo.enable=true;
      
      SELECT CAST(searchword as bigint) IS NOT NULL FROM testdb.z_tab;
      SELECT CAST(searchword as bigint) IS NULL FROM testdb.z_tab;
      

      The SQL results for both queries are the same, as follows:

      +-------+
      |  _c0  |
      +-------+
      | true  |
      | true  |
      +-------+

      SELECT CAST(searchword as bigint) IS NOT NULL FROM testdb.z_tab;  execute result is wrong

       

      Attachments

        Activity

          People

            luguangming GuangMing Lu
            luguangming GuangMing Lu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: