Support Questions

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

Beeline- unable to insert data

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)

2 ACCEPTED SOLUTIONS

avatar
Rising Star
hide-solution

This problem has been solved!

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

Register/Login

avatar
Rising Star
hide-solution

This problem has been solved!

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

Register/Login
4 REPLIES 4

avatar
Rising Star
hide-solution

This problem has been solved!

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

Register/Login

avatar

Thanks. I want to know something. Is it necessary that I need to put the file in /tmp location. Can't it work from anyother location from HDFS. Suppose if I have a file on /hello/employee.txt . Can't I use this employee.txt file from this path to load the data.

avatar
Rising Star
hide-solution

This problem has been solved!

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

Register/Login

avatar
New Contributor

we are facing another ISSSUE: inserted only partial number of rows. The source table has 7,070,150,676. The insert query ran and we could see that from the source table same number of rows were transferred and beeline end screenshot also shows numRows = 7,070,150,676 but in the target hive table only 500,912,361 many rows were inserted.

 

 

The user is using QueryGrid.

 

Please hekp us to find the issue.