[ https://issues.apache.org/jira/browse/HIVE-15389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stamatis Zampetakis updated HIVE-15389: --------------------------------------- I cleared the fixVersion field since this ticket is not resolved. Please review this ticket and if the fix is already committed to a specific version please set the version accordingly and mark the ticket as RESOLVED. According to the JIRA guidelines (https://cwiki.apache.org/confluence/display/Hive/HowToContribute) the fixVersion should be set only when the issue is resolved/closed. > Backport HIVE-15239 to branch-1 > ------------------------------- > > Key: HIVE-15389 > URL: https://issues.apache.org/jira/browse/HIVE-15389 > Project: Hive > Issue Type: Bug > Components: Spark > Affects Versions: 1.2.0, 2.1.0 > Reporter: Niklaus Xiao > Assignee: Niklaus Xiao > Priority: Major > Fix For: 1.3.0 > > Attachments: HIVE-15389.branch-1.1.patch > > > env: hive on spark engine > reproduce step: > {code} > 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 | > +-------------+------+--+ > {code} > the result should be none record -- This message was sent by Atlassian Jira (v8.20.10#820010)