Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive, mail # user - how to do random sampling in hive?


Copy link to this message
-
Re: how to do random sampling in hive?
Raihan Jamal 2012-08-14, 22:23
I think you can use here LIMIT-

Limit indicates the number of rows to be returned. The rows returned are
chosen at random. The following query returns 5 rows from t1 at random.

SELECT * FROM t1 LIMIT 5

http://karmasphere.com/hive-queries-on-table-data

*Raihan Jamal*

On Tue, Aug 14, 2012 at 3:18 PM, zuohua zhang <[EMAIL PROTECTED]> wrote:

> Would like to extract a uniform random sample from a hive table? How
> should I write the query?
> Thanks!
>