Hive导入数据的五种方式 |
您所在的位置:网站首页 › 情境导入的方式有哪几种 › Hive导入数据的五种方式 |
1. Load方式,可以从本地或HDFS上导入,本地是copy,HDFS是移动
本地:load data local inpath ‘/root/student.txt’ into table student; HDFS:load data inpath ‘/user/hive/data/student.txt’ into table student; 2. Insert方式,往表里插入insert into table student values(1,’zhanshan’); 3. As select方式,根据查询结果创建表并插入数据create table if not exists stu1 as select id,name from student; 4. Location方式,创建表并指定数据的路径create external if not exists stu2 like student location '/user/hive/warehouse/student/student.txt'; 5. Import方式,先从hive上使用export导出在导入import table stu3 from ‘/user/export/student’; |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |