含义:实质是将数据分成不同的文件。hive中的分桶和hadoop中的reduce个数相同。

  首先设置采用分桶:

    hive>set hive.enforce.bucketing=true;

    hive>create table buckets_users(id int,name string) clustered by (id) into 4 buckets;

    hive>insert overwrite table buckets_users select * from student;

      说明:按照ID分桶,分为4个桶,buckets_users 和 student表的字段要相同。

相关文章:

  • 2021-08-17
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2021-05-28
  • 2022-12-23
  • 2021-07-21
猜你喜欢
  • 2021-04-21
  • 2021-12-15
  • 2021-04-26
  • 2021-10-16
  • 2021-11-29
  • 2021-12-18
  • 2021-05-03
相关资源
相似解决方案