设为首页 加入收藏

TOP

hive创建hbase外部表
2019-02-21 12:56:14 】 浏览:169
Tags:hive 创建 hbase 外部
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_28429443/article/details/87075381

hive 启动命令:$HIVE_HOME/bin/hive

hive 创建hbase外部表:
ihr_pes为hive表名:

CREATE EXTERNAL TABLE ihr_pes(
id string comment “hbase rowkey”,
identity_no string comment “身份证号”,
org_code string comment “医院编号”,
patient_id string comment “病人id”,
patient_name string comment “病人姓名”,
physical_exam_no string comment “体检号”,
doc_title string comment “体检标题”,
doc_path string comment “存储路径”
)
STORED BY ‘org.apache.hadoop.hive.hbase.HBaseStorageHandler’
WITH SERDEPROPERTIES (“hbase.columns.mapping” = “:key,p:IDENTITY_NO,p:ORG_CODE,p:PATIENT_ID,p:PATIENT_NAME,p:PHYSICAL_EXAM_NO,p:DOC_TITLE,p:DOC_PATH”)
TBLPROPERTIES(“hbase.table.name” = “ihr:pes”);

hbase 表名:ihr:pes
备注:“hbase.columns.mapping” 下的hbase中的字段要在一行,中间以,分割不能空格或换行

先执行进入hive命令 然后执行创建外部表命令。然后直接退出hive命令

hive 退出命令:quit;

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇HIVE 数据类型转换(转) 下一篇第20天:   嵌套复杂类型

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目