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

IN operator fails when the column type is DATE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 2.0.0
    • Query Processor
    • None
    • Reviewed

    Description

      Test DLL :

      CREATE TABLE `date_dim`(
        `d_date_sk` int, 
        `d_date_id` string, 
        `d_date` date, 
        `d_current_week` string, 
        `d_current_month` string, 
        `d_current_quarter` string, 
        `d_current_year` string) ;
      

      Hive query :

          SELECT *  
          FROM   date_dim     
          WHERE d_date  IN ('2000-03-22','2001-03-22')  ;
      

      In 1.0.0 , the above query fails with:

          FAILED: SemanticException [Error 10014]: Line 1:180 Wrong arguments ''2001-03-22'': The arguments for IN should be the same type! Types are: {date IN (string, string)}
      

      I changed the query as given to pass the error :

          SELECT *  
          FROM   date_dim     
          WHERE d_date  IN (CAST('2000-03-22' AS DATE) , CAST('2001-03-22' AS DATE)  )  ;
      

      But it works without casting :

          SELECT *  
          FROM   date_dim     
          WHERE d_date   = '2000-03-22' ;
      

      Attachments

        1. HIVE-11973.1.patch
          3 kB
          Yongzhi Chen
        2. HIVE-11973.2.patch
          3 kB
          Yongzhi Chen
        3. HIVE-11973.3.patch
          5 kB
          Yongzhi Chen
        4. HIVE-11973.4.patch
          5 kB
          Yongzhi Chen

        Issue Links

          Activity

            People

              ychena Yongzhi Chen
              sanjiv singh sanjiv singh
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: