- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
BYTE data type support in Hive ?
- Labels:
-
Apache Hive
Created ‎10-11-2017 12:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created ‎10-11-2017 02:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created ‎11-08-2017 12:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created ‎11-08-2017 12:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
