Data in HDFS files not seen under hive table

5k views Asked by At

I have to create a hive table from data present in oracle tables. I'm doing a sqoop, thereby converting the oracle data into HDFS files. Then I'm creating a hive table on the HDFS files. The sqoop completes successfully and the files also get generated in the HDFS target directory. Then I run the create table script in hive. The tables gets created. But it is an empty table, no data is seen in the hive table.

Has anyone faced a similar problem?

2

There are 2 answers

0
gbharat On BEST ANSWER

Hive default delimiter is ctrlA, if you don't specify any delimiter it will take default delimiter. Add below line in your hive script .

row format delimited fields terminated by '\t'

1
gbharat On

Your Hive script and your expectation is wrong. You are trying to create a partitioned table on the data that you have already imported, partitions won't work that way. If your query has no partition in it then you can able to see data.

Basically If you want partitioned table , you can't create on the under lying data like you have tried above. If you want hive partition load the data from intermediate table or that sqoop directory to your partitioned table to get Hive partitions.