设为首页 加入收藏

TOP

Hive元数据解析(二)
2014-11-24 00:40:41 来源: 作者: 【 】 浏览:16
Tags:Hive 数据 解析
hdfs://YZSJHL19-42.opi.com/warehouse.test/acorn_3g.db/user_act

mysql> select * from SDS where SD_ID=263311 \G
*************************** 1. row ***************************
                    SD_ID: 263311
                    CD_ID: 263311
             INPUT_FORMAT: org.apache.hadoop.mapred.TextInputFormat
            IS_COMPRESSED:
                 LOCATION: hdfs://YZSJHL19-42.opi.com/warehouse.test/acorn_3g.db/user_act
              NUM_BUCKETS: -1
            OUTPUT_FORMAT: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
                 SERDE_ID: 263301
IS_STOREDASSUBDIRECTORIES: 

2.4 CDS 和 COLUMN_V2 (列信息)
CDS表
描述:
该表只有一个字段CD_ID,永远存储整个Hive数据仓库中的CD_ID.
例子:
可以看到acorn_3g.user_act表对应的CD_ID记录在CDS中
mysql> desc CDS;
+-------+------------+------+-----+---------+-------+
| Field | Type       | Null | Key | Default | Extra |
+-------+------------+------+-----+---------+-------+
| CD_ID | bigint(20) | NO   | PRI | NULL    |       |
+-------+------------+------+-----+---------+-------+
1 row in set (0.00 sec)

mysql> select * FROM CDS where CD_ID=263311;
+--------+
| CD_ID  |
+--------+
| 263311 |
+--------+
1 row in set (0.00 sec)

COLUMN_V2表
描述:
该表存储了一个CD_ID对应的所有字段信息
例子:
查看acorn_3g.user_act表的COLUMN信息;我们可以看到acorn_3g.user_act表有14个字段,COLUMN_NAME为字段名,TYPE_NAME为字段类型,INTEGER_IDX为字段序号
mysql> select * from COLUMNS_V2 where CD_ID=263311 order by  integer_idx;
+--------+---------+---------------+-----------+-------------+
| CD_ID  | COMMENT | COLUMN_NAME   | TYPE_NAME | INTEGER_IDX |
+--------+---------+---------------+-----------+-------------+
| 263311 | NULL    | id            | bigint    |           0 |
| 263311 | NULL    | action_id     | int       |           1 |
| 263311 | NULL    | user_id       | bigint    |           2 |
| 263311 | NULL    | request       | string    |           3 |
| 263311 | NULL    | visit_time    | string    |           4 |
| 263311 | NULL    | source_id     | int       |           5 |
| 263311 | NULL    | sess_id       | string    |           6 |
| 263311 | NULL    | mobile_number | string    |           7 |
| 263311 | NULL    | from_id       | string    |           8 |
| 263311 | NULL    | app_id        | string    |           9 |
| 263311 | NULL    | version       | string    |          10 |
| 263311 | NULL    | reg_type      | int       |          11 |
| 263311 | NULL    | uniqid        | string    |          12 |
| 263311 | NULL    | failure       | int       |          13 |
+--------+---------+---------------+-----------+-------------+
2.5 SERDES和SERDE_PARAMS  (序列化)

描述:
SERDES存储了所有的序列化信息(SERDE_ID,SLIB),SLIB表示序列化所采用的 Java
SERDES_PARAMS 存储序列化具体的参数及值
例子:
    acorn_3g.user_act表对应的SERDE_ID=263301表示 采用hive默认序列化类org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe , DELIMITED字符为'\t' (即创建表时指定的 ...DELIMITED BY '\t' ...)

mysql> select * FROM SERDES where SERDE_ID=263301;
+----------+------+----------------------------------------------------+
| SERDE_ID | NAME | SLIB                                               |
+----------+------+----------------------------------------------------+
|   263301 | NULL | org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe |
+----------+------+----------------------------------------------------+

mysql> select SERDE_ID,PARAM_KEY,REPLACE(PARAM_VALUE,'\t','\\t') from SERDE_PARAMS where SERDE_ID=263301;
+----------+----------------------+---------------------------------+
| SERDE_ID | PARAM_KEY            | REPLACE(PARAM_VALUE,'\t','\\t') |
+----------+----------------------+---------------------------------+
|   263301 | field.delim          | \t                              |
|   263301 | serialization.format | \t                              |
+----------+-----------
首页 上一页 1 2 3 4 下一页 尾页 2/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Oracle查询表中各列名称、表中列数 下一篇数据库日志理论以及SQLite的实现

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: