本地: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’;
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)