Akash Kumar Singh
Akash Kumar Singh

Reputation: 11

Column values are taking as 0 or nul in place of char data type in HIVE

I have a table with one of the columns having char(3) datatype. The table creation statement is working fine. But, when a try to insert into that table with a char(3) data. The code is working fine.

But, when i select * the table i am seeing 0s and sometimes NUL in that respective columns in place of the value i am inserting.

Is there any possible reasons for that??

Upvotes: 0

Views: 356

Answers (1)

avikm
avikm

Reputation: 802

Hive does not perform any type of datatype validation. So when you are inserting data with wrong schema inforamtion, it will be inserted without any issye, but same data cant be read, Null will come instead.

Please check schema information and prepare the input data as per the schema information.

Upvotes: 1

Related Questions