0
votes

Hello Below is the use case:

Below are the sqoop generated files for the table statewise testing details:

$ hadoop fs -ls /STATEWISE_TESTING_DETAILS_23_Nov/STATEWISE_TESTING_DETAILS Found 5 items -rw-r--r-- 1 cloudera supergroup 0 2020-11-23 15:38 /STATEWISE_TESTING_DETAILS_23_Nov/STATEWISE_TESTING_DETAILS/_SUCCESS -rw-r--r-- 1 cloudera supergroup 19674 2020-11-23 15:38 /STATEWISE_TESTING_DETAILS_23_Nov/STATEWISE_TESTING_DETAILS/part-m-00000 -rw-r--r-- 1 cloudera supergroup 19716 2020-11-23 15:38 /STATEWISE_TESTING_DETAILS_23_Nov/STATEWISE_TESTING_DETAILS/part-m-00001 -rw-r--r-- 1 cloudera supergroup 18761 2020-11-23 15:38 /STATEWISE_TESTING_DETAILS_23_Nov/STATEWISE_TESTING_DETAILS/part-m-00002 -rw-r--r-- 1 cloudera supergroup 20176 2020-11-23 15:38 /STATEWISE_TESTING_DETAILS_23_Nov/STATEWISE_TESTING_DETAILS/part-m-00003

I would like to load all of them into table in HIVE ...

i am unable to do so ...

HIVE : load data '/STATEWISE_TESTING_DETAILS_23_Nov/STATEWISE_TESTING_DETAILS/part-m-00000' into table STATEWISE_TESTING_DETAILS;

Fails :

FAILED: ParseException line 1:10 missing INPATH at ''/STATEWISE_TESTING_DETAILS_23_Nov/STATEWISE_TESTING_DETAILS/part-m-00000'' near ''

1

1 Answers

0
votes

Seems like you are missing INPATH in LOAD DATA statement. So try the command like below

load data inpath '/STATEWISE_TESTING_DETAILS_23_Nov/STATEWISE_TESTING_DETAILS/part-m-00000' into table STATEWISE_TESTING_DETAILS;

Also Sqoop is capable to moving data directly to Hive. This way you can make Sqoop to do the load data function or even the Hive table creation.

Check out this: -

  1. https://sqoop.apache.org/docs/1.4.7/SqoopUserGuide.html#_importing_data_into_hive
  2. https://docs.cloudera.com/HDPDocuments/HDP2/HDP-2.5.0/bk_data-access/content/using_sqoop_to_move_data_into_hive.html