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

hive on spark combine equivalent work get wrong result because of TS operation compare

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2.0, 2.1.0
    • 2.3.0
    • Spark
    • None

    Description

      env: hive on spark engine
      reproduce step:

      create table a1(KEHHAO string, START_DT string) partitioned by (END_DT string);
      create table a2(KEHHAO string, START_DT string) partitioned by (END_DT string);
      
      alter table a1 add partition(END_DT='20161020');
      alter table a1 add partition(END_DT='20161021');
      
      insert into table a1 partition(END_DT='20161020') values('2000721360','20161001');
      
      
      SELECT T1.KEHHAO,COUNT(1) FROM ( 
      SELECT KEHHAO FROM a1 T 
      WHERE T.KEHHAO = '2000721360' AND '20161018' BETWEEN T.START_DT AND T.END_DT-1 
      UNION ALL 
      SELECT KEHHAO FROM a2 T
      WHERE T.KEHHAO = '2000721360' AND '20161018' BETWEEN T.START_DT AND T.END_DT-1 
      ) T1 
      GROUP BY T1.KEHHAO 
      HAVING COUNT(1)>1; 
      
      +-------------+------+--+
      |  t1.kehhao  | _c1  |
      +-------------+------+--+
      | 2000721360  | 2    |
      +-------------+------+--+
      

      the result should be none record

      Attachments

        1. HIVE-15239.1.patch
          4 kB
          Rui Li
        2. HIVE-15239.2.patch
          11 kB
          Rui Li
        3. HIVE-15239.3.patch
          15 kB
          Rui Li
        4. HIVE-15239.4.patch
          14 kB
          Rui Li

        Issue Links

          Activity

            People

              lirui Rui Li
              wenli wangwenli
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: