[ 
https://issues.apache.org/jira/browse/HIVE-15239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15676230#comment-15676230
 ] 

wangwenli commented on HIVE-15239:
----------------------------------

[~xuefu.w...@kodak.com] different problem?   what is the problem?

come to this issue, in
{code}
org.apache.hadoop.hive.ql.optimizer.spark.CombineEquivalentWorkResolver.EquivalentWorkMatcher.compareWork()
{code}
it check operator is same or not, here the tablescan operator is same base on 
the currently impl TableScanOperatorComparator,  but they are different tables 
tablescan, should not be same.
Maybe we can add one more check, check the table is same or not.

> hive on spark combine equivalentwork get wrong result because of  tablescan 
> operation compare
> ---------------------------------------------------------------------------------------------
>
>                 Key: HIVE-15239
>                 URL: https://issues.apache.org/jira/browse/HIVE-15239
>             Project: Hive
>          Issue Type: Bug
>          Components: Spark
>    Affects Versions: 1.2.0, 2.1.0
>            Reporter: wangwenli
>
> 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
(v6.3.4#6332)

Reply via email to