使用hive元数据查看
- 查询数据库
- 查看表
- 查看某个数据库下的表
- 查看分区
- 查看某个表的分区
- 查看某个表的列
使用元数据增加表
-
增加序列化使用的类信息
在SERDES这个表里增加一个SERDE_ID = 1216。
-
增加字段id
在CDS 这个表里增加一个字段CD_ID,与SDS表关联。
CDS CD_ID = 1093
-
增加关联字段
在sds表里增加信息
这里的SERDE_ID 和CD_ID都是需要先添加的。因为这个表的外表指定了。
-
增加字段
在columns_v2表里增加字段
-
增加表
在tbls表里增加表信息
验证增加的表
0: jdbc:hive2://hadoop-02.unicom.com:2181,had> show tables;
其中test就是刚才创建的表。
0: jdbc:hive2://hadoop-02.unicom.com:2181,had> desc test;
这两个字段也是刚刚添加的。
往表里加条数据:
0: jdbc:hive2://hadoop-02.unicom.com:2181,had> insert into table test values (1,2);
然后查看:
0: jdbc:hive2://hadoop-02.unicom.com:2181,had> select * from test;