Hive使用小记

  • 内部表与外部表之间的转换
    查阅官网:https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL
    官网关于内部表、外部表转换的解释:

    • TBLPROPERTIES (“EXTERNAL”=”TRUE”) in release 0.6.0+ (HIVE-1329) – Change a managed table to an external table and vice versa for “FALSE”.

      • As of Hive 2.4.0 (HIVE-16324) the value of the property ‘EXTERNAL’ is parsed as a boolean (case insensitive true or false) instead of a case sensitive string comparison.

      示例:
      alter table tableName set tblproperties ('EXTERNAL'='TRUE|FALSE');

  • 修改分区字段
    查阅官网:https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL
    这里写图片描述
    示例:
    ALTER TABLE table_name PARTITION (dt='2018-05-06') RENAME TO PARTITION (dt='20180506');

你可能感兴趣的:(Hive)