# 下载
hdfs dfs -getmerge /user/hive/warehouse/tempon.db/tl_text_center /home/admin/t1_subject.txt
# 建外部表
drop table tempon.text_anti_brush_info
create external table if not exists tempon.text_anti_brush_info (
sourceId string COMMENT '{"sourceId":"文本ID", "description":"sourceId"}',
strategyCode string COMMENT '{"strategyCode":"策略代码", "description":"strategyCode"}'
)
comment '文本防刷日志解析临时表'
row format delimited
fields terminated by '\t'
collection items terminated by '\002'
map keys terminated by '\003'
lines terminated by '\n'
stored as textfile
location '/user/admin/deploy/text_anti_brush';
# 创建路径
hdfs dfs -mkdir '/user/admin/deploy/text_anti_brush';
# 删除路径
hdfs dfs -rm /user/admin/deploy/text_anti_brush/t1_subject_info.txt
# put数据
hdfs dfs -put -f /home/admin/t1_subject_info.txt /user/admin/deploy/text_anti_brush/
【hdfs 常用命令】数据put到hdfs
最新推荐文章于 2024-06-08 08:45:00 发布