Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

BYTE data type support in Hive ?

avatar
New Contributor

I have multiple BYTE data type date like "00-00-8D-AC" and in hive i have tried column data type with Varchar(50)/String but after loading the data into hive the output is coming as NULL.

Please provide your suggestion which data type is suitable in hive to accept BYTE data type.

3 REPLIES 3

avatar
Expert Contributor

Not sure what is the final use case, but one way to do this is:

hive> CREATE TABLE foo (bar CHAR(8));
hive> insert into foo values ("00008DAC");
hive> select * from foo;
OK
00008DAC

avatar
New Contributor

i don't want to change the values, The data is like "00-00-8D-AC", "00-01-8D-AK". so in this case which data type will help.

avatar
Super Guru

@MONORANJAN MOHAPATRA,

You can use approach suggested by @Slim assuming all the data is of fixed length. You can change it as below

hive> CREATE TABLE foo (bar CHAR(11));
hive> insert into foo values ("00-00-8D-AC");
hive> select * from foo;
OK
00-00-8D-AC

Thanks,

Aditya