hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xuefu Zhang (JIRA)" <>
Subject [jira] [Commented] (HIVE-19671) Distribute by rand() can lead to data inconsistency
Date Thu, 21 Jun 2018 00:21:00 GMT


Xuefu Zhang commented on HIVE-19671:

Based on your analysis, it seems that random(see) depends on a deterministic order of the
data. Reading HDFS may guarantee the order, but probably not every data source has such guaranty.
Also, a map or reduce logic may also generate nondeterministic order. Having said that, it
appears to me that any partitioning that depends on a deterministic ordering of the data is
doomed, include rand() and rand(seed). This is rather a user problem, for which I'm not sure
if Hive needs to do anything. We may document this as a general bad practice, but blocking
solves rand() problemI  but doesn't help other similar problems. I suggest we leave it to
user to solve the problem. Thoughts?

> Distribute by rand() can lead to data inconsistency
> ---------------------------------------------------
>                 Key: HIVE-19671
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Rui Li
>            Assignee: Rui Li
>            Priority: Major
> Noticed the following queries can give different results:
> {code}
> select count(*) from tbl;
> select count(*) from (select * from tbl distribute by rand()) a;
> {code}

This message was sent by Atlassian JIRA

View raw message