【问题标题】:How to sample for each group in hive?如何对蜂巢中的每一组进行采样?
【发布时间】:2016-03-09 09:14:20
【问题描述】:

我在 hive 中有一个大表,其中包含 15 亿个以上的值。其中一列是 category_id,它有大约 20 个不同的值。我想对表格进行采样,以便每个类别都有 1 百万个值。

我查看了 Random sample table with Hive, but including matching rowsHive: Creating smaller table from big table 并想出了如何从整个表中获取随机样本,但我仍然无法弄清楚如何为每个 category_id 获取样本。

【问题讨论】:

    标签: hadoop hive hiveql


    【解决方案1】:

    我了解到您希望在多个文件中对表格进行抽样。您可能需要检查 Hive bucketingDynamic partitions 以平衡多个文件夹/文件之间的记录。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-23
      • 1970-01-01
      • 1970-01-01
      • 2015-06-17
      • 2019-04-17
      • 2015-03-10
      • 1970-01-01
      • 2020-05-19
      相关资源
      最近更新 更多