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

cast type mismatch and use is not null, the results are error if cbo is true

    XMLWordPrintableJSON

Details

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

    Description

      1.CREATE TABLE IF NOT EXISTS testa
      (
      SEARCHWORD STRING,
      COUNT_NUM BIGINT,
      WORDS STRING
      )
      ROW FORMAT DELIMITED FIELDS TERMINATED BY '\27'
      STORED AS TEXTFILE; 

      2.insert into testa values('searchword', 1, 'a');

      3.set hive.cbo.enable=false;

      4.SELECT
      CASE
      WHEN CAST(searchword as bigint) IS NOT NULL THEN CAST(CAST(searchword as bigint) as String)
      ELSE searchword
      END AS WORDS,
      searchword FROM testa;

      5.set hive.cbo.enable=true;

      6.SELECT
      CASE
      WHEN CAST(searchword as bigint) IS NOT NULL THEN CAST(CAST(searchword as bigint) as String)
      ELSE searchword
      END AS WORDS,
      searchword FROM testa;

      Attachments

        1. image-2020-08-31-10-01-26-250.png
          6 kB
          zhaolong
        2. image-2020-08-31-10-02-39-154.png
          7 kB
          zhaolong
        3. image-2020-09-04-10-54-43-141.png
          3 kB
          zhaolong
        4. image-2020-09-04-10-56-00-764.png
          1 kB
          zhaolong
        5. image-2020-09-04-10-56-07-286.png
          3 kB
          zhaolong
        6. image-2020-09-04-10-59-36-780.png
          3 kB
          zhaolong
        7. image-2020-09-04-11-02-07-917.png
          3 kB
          zhaolong
        8. image-2020-09-04-11-02-18-008.png
          3 kB
          zhaolong
        9. image-2020-09-07-15-20-44-201.png
          3 kB
          zhaolong
        10. image-2020-09-07-15-21-35-566.png
          1 kB
          zhaolong
        11. image-2020-09-07-15-24-59-015.png
          31 kB
          zhaolong
        12. image-2020-09-07-15-25-18-785.png
          21 kB
          zhaolong
        13. image-2020-09-08-16-42-54-728.png
          3 kB
          zhaolong
        14. image-2020-09-08-16-43-00-848.png
          2 kB
          zhaolong

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fsilent zhaolong
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: