hive导入文件到hive表操作:
1、hdfs导入:load data inpath ‘/home/hive/student.txt’ into table student;
2、本地导入:load data local inpath ‘/hive/data/student.txt’ into table student;
mysql导入文件的到mysql表操作:
1、服务端导入:load data infile “D:\student.txt” into table student delimited fields terminated by ‘,’;
2、本地导入:load data local infile “D:\student.txt” into table student delimited fields terminated by ‘,’;
这里遇到找不到文件的问题:正确信息与出错信息
LOAD data local INFILE “C:\Users\Administrator\Desktop\hivetest\student.txt” into table student fields terminated by ‘,’
Affected rows: 17
时间: 0.005s
LOAD data local infile “C:\Users\Administrator\Desktop\hivetest\score.txt” into table score fields terminated by ‘,’
2 - File ‘C:UsersAdministratorDesktophivetestscore.txt’ not found (Errcode: 2 “No such file or directory”)
时间: 0s
原因就是在window中,路径要写成双斜杠才会被识别