美文网首页
Hive表属性操作

Hive表属性操作

作者: 发条香蕉 | 来源:发表于2016-08-30 20:33 被阅读0次

表属性操作

  • 修改表名
    • alter table table_name rename to new_table_name;
  • 修改列名
    • alter table tablename change column c1 c2 int comment 'xxxx';

      after severity;//可以吧该列放到指定列的后面,或者使用‘first’放到第一位

      alter table test change column type type string after name;

      alter table test change column type type string first;

  • 增加列
    • alter table tablename add columns(c1 string comment 'xxxx',c2 long comment 'yyyy')
  • 修改tblproperties
    • alter table table_name set tblproperties(property_name = property_value,property_name= property_value,...)
  • 针对无分区表与有分区表不同
    • alter table table_name set serdeproperties ('field.delim' = '\t')
  • 有分区表
    • alter table test1 partition(dt='xx') set serdeproperties('field.delim'='\t')
  • 修改location
    • alter table table_name [partition(...)] set location 'path'
  • alter table table_name set tblproperties('external'='true')//内部表转外部表
  • alter table table_name set tblproperties('external'='false')//外部表转内部表
  • ...
    • alter table properties
    • alter serde properties
    • alter table/partition file format
    • alter table storage properties
    • alter table rename partition
    • alter talbe set location
  • wiki LanguageManual DDL

相关文章

  • Hive表属性操作

    表属性操作 修改表名alter table table_name rename to new_table_name...

  • [Hive]表属性操作

    业务的调整,我不得不去修改表的一些信息 Hive表重命名ALTER TABLE RENAME TO ; 修改...

  • hive基础语法

    目录 Hive安装和启动 Hive表操作-分区表 Hive表操作-复杂类型操作 Hive 查询语句 Zepplin...

  • hive进阶学习

    创建hive表常用语句: 修改hive表名称: 内部表 vs 外部表: 创建分区表以及补充操作: hive中查询介...

  • 数据仓库-Hive基础(五)Hive 的基本操作

    1. 数据库操作 1.1 创建数据库 说明:hive的表存放位置模式是由hive-site.xml当中的一个属性指...

  • Hive 表属性

    一、create table if not exists 用于防止所建的表名已存在而报错 二、comment 字段...

  • Hive之同比环比的计算

    Hive系列文章 Hive表的基本操作[http://www.ikeguang.com/?p=1657] Hive...

  • HIVE

    基本操作 hive进入hive模式 exit; 退出hive模式 展示正则匹配表名hive> use ad_s...

  • Hive sql常见操作

    基本sql操作 hive表操作 分区操作 Hive内置函数 (1)数学函数 常用的数学函数都有:round、flo...

  • Hive数据库连接操作雷区

    基础操作测试 首先准备两张表收入表 hive_join_gaap_test 和 信息表 hive_join_pl_...

网友评论

      本文标题:Hive表属性操作

      本文链接:https://www.haomeiwen.com/subject/ancqettx.html