You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Jasper Knulst (JIRA)" <ji...@apache.org> on 2014/11/14 14:46:34 UTC
[jira] [Updated] (HIVE-8871) Hive Hbase Integration : Support for
NULL value columns
[ https://issues.apache.org/jira/browse/HIVE-8871?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jasper Knulst updated HIVE-8871:
--------------------------------
Description:
If you map a Hive column to a Hbase CF where the CF only has qualifiers but no values, Hive always outputs ' {} ' for that key. This hides the fact that qualifiers do exist within the CF. As soon as you put a single byte (like a space) as value you'll get a return like this ' {"20140911"," "} in Hive.
Since it is a common data modelling technique in Hbase to not use the value (and essentially use the qualifier in a CF as value holder) I think it would be worthwhile to have some support for this in the Hbase handler.
A solution could be to show a data structure like CF:qualifier:<NULL> like this: {"20140911",""}
, where '20140911' is the qualifier and NULL value in Hbase are shown as empty json strings.
CREATE EXTERNAL TABLE hb_test (
userhash string,
count bigint,
dates map<string,string>)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES (
"hbase.columns.mapping" =
":key,SUM:COUNT,DATES:",
"hbase.table.default.storage.type" = "binary"
)
TBLPROPERTIES("hbase.table.name" = "test");
was:
If you map Hive to a Hbase table where one CF only has qualifiers but no values, Hive always outputs ' {} ' for that key. As soon as you put a single byte (like a space) as value you'll get a return like this ' {"20140911"," "}.
Since it is a common data modelling technique in Hbase to not use the value (and essentially use the qualifier in a CF as value holder) I think it would be worthwhile to have some support for this in the Hbase handler.
A solution could be to show a data structure like CF:qualifier:<NULL> like this: {"20140911",""}
, where '20140911' is the qualifier and NULL value in Hbase are shown as empty json strings.
CREATE EXTERNAL TABLE hb_test (
userhash string,
count bigint,
dates map<string,string>)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES (
"hbase.columns.mapping" =
":key,SUM:COUNT,DATES:",
"hbase.table.default.storage.type" = "binary"
)
TBLPROPERTIES("hbase.table.name" = "test");
> Hive Hbase Integration : Support for NULL value columns
> --------------------------------------------------------
>
> Key: HIVE-8871
> URL: https://issues.apache.org/jira/browse/HIVE-8871
> Project: Hive
> Issue Type: Bug
> Components: HBase Handler
> Affects Versions: 0.10.0
> Reporter: Jasper Knulst
> Labels: features
>
> If you map a Hive column to a Hbase CF where the CF only has qualifiers but no values, Hive always outputs ' {} ' for that key. This hides the fact that qualifiers do exist within the CF. As soon as you put a single byte (like a space) as value you'll get a return like this ' {"20140911"," "} in Hive.
> Since it is a common data modelling technique in Hbase to not use the value (and essentially use the qualifier in a CF as value holder) I think it would be worthwhile to have some support for this in the Hbase handler.
> A solution could be to show a data structure like CF:qualifier:<NULL> like this: {"20140911",""}
> , where '20140911' is the qualifier and NULL value in Hbase are shown as empty json strings.
> CREATE EXTERNAL TABLE hb_test (
> userhash string,
> count bigint,
> dates map<string,string>)
> STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
> WITH SERDEPROPERTIES (
> "hbase.columns.mapping" =
> ":key,SUM:COUNT,DATES:",
> "hbase.table.default.storage.type" = "binary"
> )
> TBLPROPERTIES("hbase.table.name" = "test");
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)