Support Questions
Find answers, ask questions, and share your expertise

BMp Image data to hive

New Contributor

Hello,

 

I am trying to load bmp image data to hive and getting below error. I went through many past discussions but didn't find an exact solution to implement.

 

Appreciate your help in solving this. 

 

Steps I followed.

 

1: Copied the images to HDFS

2: Created a table with a column Binary

3: Load using data in path.

 

Error:  Error while compiling statement: FAILED: SemanticException Unable to load data to destination table. Error: The file that you are trying to load does not match the file format of the destination table.

 

My scripts:

create table wrk_image 
(id int
, filename STRING
, data BINARY
);

load data inpath '/warehouse/tablespace/external/hive/cadt.db/scriptpro/' into table wrk_image;

3 REPLIES 3

Expert Contributor

Please provide the below information:

 

 1. What is the version? HDP/CDP/CDH ?

 

 2. provide "scriptpro"

 

 3. What si the error recieved ?

New Contributor

Hi Asis,

 

Here is the info.

 

CDH version :  CDH-7.1.5

Scripture : its just a directory I created under db.

Error:

Error while compiling statement: FAILED: SemanticException Unable to load data to destination table. Error: The file that you are trying to load does not match the file format of the destination table.

 

Please let me know if you need more information.

 

Thanks,

Sai

Expert Contributor

Hi Sai,

 

Please follow https://community.cloudera.com/t5/Support-Questions/Does-hive-support-Photo-or-images-datatypes/td-p...

 

Copy the data to hdfs instead of loadpath and check,

 

Thanks,
Asish