Reply
New Contributor
Posts: 4
Registered: ‎06-30-2016

[HELP!!!] Sqoop import table to hive, not shown on hive (CM 5.7.x)

[ Edited ]

Use the Command below to import data from postgresql to hive

$ sqoop import --connect jdbc:postgresql://my host/cqdb --username test --table test --split-by value --hive-import ----direct

 

There is corresponding file under hdfs

$ hadoop fs -ls /user/hive/warehouse

 

drwxrwxrwt - root hive 0 2016-06-30 19:06 /user/hive/warehouse/test

 

 

The file could not be shown on hive

$ hive
hive> show tables;
OK
Time taken: 1.731 seconds

 

Any body could help appreciate.

 

 

 

New Contributor
Posts: 1
Registered: ‎05-25-2018

Re: [HELP!!!] Sqoop import table to hive, not shown on hive (CM 5.7.x)

Hi,

You just imported test table from postgresql to hdfs.

now next you open hive prompt and load this table into hive.

 

# hive

hive> load data inpath '/user/hive/warehouse/test' into table test;

hive> show tables;

Champion
Posts: 753
Registered: ‎05-16-2016

Re: [HELP!!!] Sqoop import table to hive, not shown on hive (CM 5.7.x)

 

what user are you firing the sqoop ? 

try using the below parameter 

the ouput of the mapreduce should give you some information  byte written . 

--target-dir or --warehouse-dir

 

Announcements