安装hive
直接操作hive
加载数据到数据表中,
load data local inpath '/data/app/lijianzhen/hive/l_employee.txt' overwrite into table L_EMPLOYEE;
在这里load时候出现FAILED: SemanticException Line 1:23 Invalid path '"/data/app/lijianzhen/hive/l_employee.txt"': No files matching path file:/data/app/lijianzhen/hive/l_employee.txt
这时你用下边的命令看看你是不是可以读的数据
文件中的内容为,这里注意创建表的时候fields terminated by '\t'所以在txt中列注意要用'\t'隔开
[table]
|1202 | Manisha |45000| Proof reader|
|1203 | Masthanvali
直接操作hive
create table if not exists L_EMPLOYEE (eid int,name String,salary String,destination String)
COMMENT 'Employee details'
ROW FORMAT delimited
fields terminated by '\t'
lines terminated by '\n'
stored as textfile;
加载数据到数据表中,
load data local inpath '/data/app/lijianzhen/hive/l_employee.txt' overwrite into table L_EMPLOYEE;
在这里load时候出现FAILED: SemanticException Line 1:23 Invalid path '"/data/app/lijianzhen/hive/l_employee.txt"': No files matching path file:/data/app/lijianzhen/hive/l_employee.txt
这时你用下边的命令看看你是不是可以读的数据
less /data/app/lijianzhen/hive/l_employee.txt
文件中的内容为,这里注意创建表的时候fields terminated by '\t'所以在txt中列注意要用'\t'隔开
[table]
|1202 | Manisha |45000| Proof reader|
|1203 | Masthanvali