日志表 ods_log
1、原始数据
{
“common”: { },
“start”: { },
“err”: { },
“ts”: { }
}
2、如果要创建的表已经存在,先删除该表
drop table if exists ods_log;
3、创建一张外部表
create external table ods_log(
line string
)
(1)按照时间进行分区
partitioned by(
`dt` string
)
(2)LZO压缩格式处理
到 Hive 官网找到:
Documentation -> Language Manual -> File Formats -> LZO Compression -> Table Definition
stored as
inputformat "com.hadoop.mapred.DeprecatedLzoTextInputFormat"
outputformat