在HUE中将文本格式的数据导入hive数仓中

今天有一个需求需要将一份文档形式的hft与fdd的城市关系关系的数据导入到hive数仓中,之前没有在hue中进行这项操作(上家都是通过xshell登录堡垒机直接连服务器进行操作的),特此记录一下。

-- step1
-- 创建表(注意表的存储格式)
create table if not exists edw_public.dim_edw_pub_hft_fdd_city_rel_info(
hft_city_id     bigint  comment '好房通城市id',
hft_city_name   String  comment '好房通城市名称',
fdd_city_id     bigint  comment '房多多城市id',
fdd_city_name   String  comment '房多多城市名称'
) comment '好房通房多多city_id关联关系表'
row format delimited fields terminated by '\t'
stored as textfile;

-- step2
-- 将文本格式的文件放入HDFS对应目录下

-- step3
-- 将数据导入表中
load data inpath '/edw/edw_public/DWD/DDL/edw_public.dim_edw_pub_hft_fdd_city_rel_info/hft_fdd_city_rel_info.txt' into table edw_public.dim_edw_pub_hft_fdd_city_rel_info

猜你喜欢

转载自www.cnblogs.com/shujuxiong/p/10415401.html