栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

大数据学习-hive(一:如何上传csv数据到hive表)

大数据学习-hive(一:如何上传csv数据到hive表)

一:建表
create table temp.dim_dk_vehicle_info_01
(
ecu_id string
,key_type string
,status string
)comment 'tmp中dim层车辆维度信息表'
    row format delimited
    fields terminated by ','
    collection items terminated by 'n'
    stored as textfile
;
表存储格式为textfile。
二:上传表到服务器
可以通过堡垒机或者xshell进行上传。
三:将文件上传到hdfs上。
hdfs dfs -put /root/aaa.csv   /opt
四:打开hive进行传输数据。
1. hive
2.  load data inpath '/opt/aaa.csv' into table temp.dim_dk_vehicle_info;
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/742827.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号