当前位置:   article > 正文

hive 分桶_hive分桶表创建 orc

hive分桶表创建 orc
  1. CREATE [EXTERNAL] TABLE <table_name>
  2. (<col_name> <data_type> [, <col_name> <data_type> ...])]
  3. [PARTITIONED BY ...]
  4. CLUSTERED BY (<col_name>)
  5. [SORTED BY (<col_name> [ASC|DESC] [, <col_name> [ASC|DESC]...])]
  6. INTO <num_buckets> BUCKETS
  7. [ROW FORMAT <row_format>]
  8. [STORED AS TEXTFILE|ORC|CSVFILE]
  9. [LOCATION '<file_path>']
  10. [TBLPROPERTIES ('<property_name>'='<property_value>', ...)];

具体示例

分桶关键字CLUSTERED BY (<col_name>)

只能指定一个列名,会根据指定的列名的hash进行分桶

  1. create table users(id int,name string) clustered by (<id>) into 3 buckets
  2. row format delimited
  3. fields terminated by '\t'
  4. lines terminated by '\n'
  5. stored as textfile;

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/486406
推荐阅读
相关标签
  

闽ICP备14008679号