Skip to main content
saidvs
Gold ⭐️
July 16, 2021
Question

BMp Image data to hive

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

asish
Gold ⭐️⭐️⭐️
Gold ⭐️⭐️⭐️
July 18, 2021

Please provide the below information:

 

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

 

 2. provide "scriptpro"

 

 3. What si the error recieved ?

Translate
saidvs
saidvsAuthor
Gold ⭐️
July 19, 2021

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

Translate
asish
Gold ⭐️⭐️⭐️
Gold ⭐️⭐️⭐️
July 19, 2021

Hi Sai,

 

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

 

Copy the data to hdfs instead of loadpath and check,

 

Thanks,
Asish

Translate