impala建表脚本

IMPALA="sudo -u hdfs impala-shell -q"

db_name="chenzl"
table_name="kn1_base_conf_group"

$IMPALA<< EOF
USE ${db_name};
DROP TABLE ${table_name};
CREATE EXTERNAL TABLE ${table_name}
(
day_key               string               comment'日期',
group_id               bigint               comment'组编号',
group_name               string               comment'组名称',
realgroup_id               bigint               comment'真实组编号',
realgroup_name               string               comment'真实组名称',
app_service_id               bigint               comment'应用服务编号',
app_service_name               string               comment'应用服务名称',
service_state               string               comment'服务状态',
node_id               bigint               comment'节点编号',
node_name               string               comment'节点名称',
area               string               comment'区域',
province               string               comment'省份',
isp               string               comment'运营商编码',
isp_cnname               string               comment'运营商名称',
province_name               string               comment'省份名称',
area_name               string               comment'大区'
)
COMMENT '组信息维度表'
ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION '/user/hive/warehouse/dw/kn1_base_conf_group';
ALTER TABLE ${table_name} SET SERDEPROPERTIES('serialization.null.format'='');
EOF


ALTER TABLE kn1_base_conf_group SET SERDEPROPERTIES('serialization.null.format'='');
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值