Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

beeline "Invalid Path" "No files matching path file"

avatar
Explorer

Good morning.  After my local Hadoop User Group meeting last night, I decided to switch over from using the native "hive" shell to "beeline."  I can't remember the exact reasons, but the wonderful speaker made a point of saying users needed to back way from using the native "hive" shell for some very good reasons that I've forgotten after three beers last night.

 

In anysense, I took the advice and fired up beeline this morning.  Everything seems to be working well, but when trying to load data, I get an "Invalid Path" error.  Below you can see that when not fully qualifying the file name, the working directory is set to where the properties and such are stored.  That's fine.

 

Connected to: Apache Hive (version 0.13.1-cdh5.2.0)
Driver: Hive JDBC (version 0.13.1-cdh5.2.0)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 0.13.1-cdh5.2.0 by Apache Hive
0: jdbc:hive2://c-10-206-76-8.int.cis.trcloud> load data local inpath 'hourly_TEMP_2014.csv' into table temps_txt;
Error: Error while compiling statement: FAILED: SemanticException Line 1:23 Invalid path ''hourly_TEMP_2014.csv'': No files matching path file:/var/run/cloudera-scm-agent/process/24-hive-HIVESERVER2/hourly_TEMP_2014.csv (state=42000,code=40000)

 

This is fine, I can fully qualify the file.  However, even when I do that, I still get that the file is not found.

 

0: jdbc:hive2://c-10-206-76-8.int.cis.trcloud> load data local inpath '/home/cloud/hourly_TEMP_2014.csv' into table temps_txt;
Error: Error while compiling statement: FAILED: SemanticException Line 1:23 Invalid path ''/home/cloud/hourly_TEMP_2014.csv'': No files matching path file:/home/cloud/hourly_TEMP_2014.csv (state=42000,code=40000)
0: jdbc:hive2://c-10-206-76-8.int.cis.trcloud> !quit
Closing: 0: jdbc:hive2://c-10-206-76-8.int.cis.trcloud:10000/default
cloud@c-10-206-76-8:~> ls -l /home/cloud/* | grep TEMP
-rw-rw-r-- 1 cloud cloud 1180101268 Jan 22 21:28 /home/cloud/hourly_TEMP_2014.csv

 

When I issue these commands via the "hive" shell, the file location resolves fine - both relatively and fully qualified.  I'm going to upgrade my small cluster to CDH 5.3.0 to see if the Hive version + backports change the behavior, but figured I'd post this to see if anyone has seen this issue with the 5.2.0 release.

 

Thanks for your time.

 

(Oh, also in the "Labels" section of this forum, there is only CDH 4.x options to choose from and it's a required field.  So I selected 4.6.x, even though this is realted to CDH 5.2.0.  Just thought I'd note that.  Or it could be that I'm in the wrong area.  Wouldn't be the first time.)

 

1 ACCEPTED SOLUTION

avatar
Explorer
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
12 REPLIES 12

avatar
Rising Star

Hi, if its a local file, then it has to be on the machine that HiveServer2 is running in, as its the process that is going to do the loading.  Can you check that?  Thanks.

avatar
Explorer
Thanks Szehon. The file is not on the HiveServer2 machine. I will try to
move the file into HDFS and then load from there to see if that works
instead. Might be that the "LOCAL" option is not an option with beeline
clients not running on the HiveServer2.

avatar
Explorer
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar

McDonald,

 

I get the same error even in the Cloudera quick start VM 5.3

 

As you know, it is a pseudo-distributed hadoop cluster, meaning, all services including HiveServer2 are on one machine only.

 

So it seems more like a beeline bug, rather than the explanation you provided.

 

Same works with the hive CLI, but fails with beeline on Cloudera 5.3 Quick start VM

 

beeline

 

0: jdbc:hive2://localhost:10000> LOAD DATA LOCAL INPATH '/home/cloudera/datasets/ml-100k/u.data' INTO TABLE u_data;
Error: Error while compiling statement: FAILED: SemanticException Line 1:23 Invalid path ''/home/cloudera/datasets/ml-100k/u.data'': No files matching path file:/home/cloudera/datasets/ml-100k/u.data (state=42000,code=40000)
0: jdbc:hive2://localhost:10000> !quit
Closing: 0: jdbc:hive2://localhost:10000

 

The /home/cloudera/datasets/ml-100k/u.data was owned by cloudera:cloudera. I even gave chmod o+r  to this file. But still same problems.

 

 

hive

 

Logging initialized using configuration in file:/etc/hive/conf.dist/hive-log4j.properties
hive> LOAD DATA LOCAL INPATH '/home/cloudera/datasets/ml-100k/u.data' INTO TABLE u_data;
Copying data from file:/home/cloudera/datasets/ml-100k/u.data
Copying file: file:/home/cloudera/datasets/ml-100k/u.data
Loading data to table default.u_data
Table default.u_data stats: [numFiles=1, numRows=0, totalSize=1979173, rawDataSize=0]
OK
Time taken: 3.136 seconds
hive>

 

-Thanks

Srini

avatar
Explorer

I have the same issue with beeline when loading local file. The file is local to HiveServer2. It works with apache and other distributions. This seems to be bug with beeline in Cloudera. Any fix available for this.

avatar
New Contributor

I am also seeing the same exception though Hive, Beeline...etc are all in the same machine! 

avatar
Explorer
This error could be due to the execute permission missing for the file path (all directories in the path including). If permission for the complete path is set to 755, it will work then.

avatar

Hi

Uploading the data from HDFS or from local works but it shows NULL value in every column instead of data. Kindly help :-

 

while loading the data from HDFS:-

0: jdbc:hive2://localhost:10000> create table transaction(sr int,id int,amount int,product string,city string,date string);
No rows affected (0.114 seconds)
0: jdbc:hive2://localhost:10000> show tables;
+---------------+--+
|   tab_name    |
+---------------+--+
| transaction   |
| transaction1  |
+---------------+--+
2 rows selected (0.046 seconds)
0: jdbc:hive2://localhost:10000> load data inpath '/priyanka/txn' into table transaction;
No rows affected (0.568 seconds)
0: jdbc:hive2://localhost:10000> select * from transaction;
+-----------------+-----------------+---------------------+----------------------+-------------------+-------------------+--+
| transaction.sr  | transaction.id  | transaction.amount  | transaction.product  | transaction.city  | transaction.date  |
+-----------------+-----------------+---------------------+----------------------+-------------------+-------------------+--+
| NULL            | NULL            | NULL                | NULL                 | NULL              | NULL              |
| NULL            | NULL            | NULL                | NULL                 | NULL              | NULL              |
| NULL            | NULL            | NULL                | NULL                 | NULL              | NULL              |
| NULL            | NULL            | NULL                | NULL                 | NULL              | NULL              |
| NULL            | NULL            | NULL                | NULL                 | NULL              | NULL              |
| NULL            | NULL            | NULL                | NULL                 | NULL              | NULL              |
| NULL            | NULL            | NULL                | NULL                 | NULL              | NULL              |
+-----------------+-----------------+---------------------+----------------------+-------------------+-------------------+--+
7 rows selected (0.154 seconds)

 

2) while loading the data from local:-

0: jdbc:hive2://localhost:10000> LOAD DATA LOCAL INPATH 'home/cloudera/txn' INTO table transaction1;
No rows affected (2.394 seconds)
0: jdbc:hive2://localhost:10000> select * from transaction1;
+------------------+------------------+----------------------+-----------------------+--------------------+--------------------+--+
| transaction1.sr  | transaction1.id  | transaction1.amount  | transaction1.product  | transaction1.city  | transaction1.date  |
+------------------+------------------+----------------------+-----------------------+--------------------+--------------------+--+
| NULL             | NULL             | NULL                 | NULL                  | NULL               | NULL               |
| NULL             | NULL             | NULL                 | NULL                  | NULL               | NULL               |
| NULL             | NULL             | NULL                 | NULL                  | NULL               | NULL               |
| NULL             | NULL             | NULL                 | NULL                  | NULL               | NULL               |
| NULL             | NULL             | NULL                 | NULL                  | NULL               | NULL               |
| NULL             | NULL             | NULL                 | NULL                  | NULL               | NULL               |
| NULL             | NULL             | NULL                 | NULL                  | NULL               | NULL               |
+------------------+------------------+----------------------+-----------------------+--------------------+--------------------+--+
7 rows selected (1.279 seconds)

avatar
Rising Star

Hey,

I just posted a reply to the other thread you created.