Is LIMIT clause in HIVE really random?

前端 未结 3 1765
醉话见心
醉话见心 2020-12-31 08:57

The documentation of HIVE notes that LIMIT clause returns rows chosen at random. I have been running a SELECT table on a

3条回答
  •  旧巷少年郎
    2020-12-31 09:40

    To be safe you want to use

    select * from table

    distribute by rand()

    sort by rand()

    limit 10000;

提交回复
热议问题