版权声明:个人原创,转载请标注! https://blog.csdn.net/Z_Date/article/details/84035052
将数据导入到hive中,但是实际上来说hive中的数据也是在hdfs上进行保存的。在进行导入hive的本质其实就是先把数据导入到hdfs 在从hdfs把数据迁移到hive表所在的hdfs路径
范例:从mysql数据库中导入数据到hive中
sqoop import \
--connect jdbc:mysql://mini3:3306/hive \
--username root \
--password Root123@ \
--table tohdfs \
--hive-import \
--hive-database student \
--hive-table stu_info \
--target-dir /tohdfs3 \
--fields-terminated-by '\t' \
--num-mappers 1
之后在hive中准备要导入的数据库以及数据表
create database student;
创建数据表,准备接收导入的数据
create table stu_info(id int,name string)
row format delimited fields terminated by '\t';