You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Swarnim Kulkarni (JIRA)" <ji...@apache.org> on 2013/08/04 17:31:48 UTC

[jira] [Updated] (HIVE-4995) select * may incorrectly return empty fields with hbase-handler

     [ https://issues.apache.org/jira/browse/HIVE-4995?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Swarnim Kulkarni updated HIVE-4995:
-----------------------------------

    Attachment: HIVE-4995.1.patch.txt
    
> select * may incorrectly return empty fields with hbase-handler
> ---------------------------------------------------------------
>
>                 Key: HIVE-4995
>                 URL: https://issues.apache.org/jira/browse/HIVE-4995
>             Project: Hive
>          Issue Type: Bug
>          Components: HBase Handler
>    Affects Versions: 0.11.0
>            Reporter: Swarnim Kulkarni
>            Assignee: Swarnim Kulkarni
>         Attachments: HIVE-4995.1.patch.txt
>
>
> HIVE-3725 added capability to pull hbase columns with prefixes. However the way the current logic to add columns stands in HiveHBaseTableInput format, it might cause some columns to incorrectly display empty fields.
> Consider the following query:
> {noformat}
> CREATE EXTERNAL TABLE test_table(key string, value1 map<string,string>, value2 string)
> ROW FORMAT SERDE 'org.apache.hadoop.hive.hbase.HBaseSerDe' 
> STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' 
> WITH SERDEPROPERTIES 
> ("hbase.columns.mapping" = ":key,cf-a:prefix.*,cf-a:another_col") 
> TBLPROPERTIES ("hbase.table.name" = "test_table");
> {noformat}
> Given the existing logic in HiveHBaseTableInputFormat:
> {code}
> for (int i = 0; i < columnsMapping.size(); i++) 
> {
>         ColumnMapping colMap = columnsMapping.get(i);
>         if (colMap.hbaseRowKey) {
>           continue;
>         }
>         if (colMap.qualifierName == null) {
>           scan.addFamily(colMap.familyNameBytes);
>         } else {
>           scan.addColumn(colMap.familyNameBytes, colMap.qualifierNameBytes);
>         }
> }
> {code}
> So for the above query, the 'addFamily' will be called first followed by 'addColumn' for the column family "cf-a". This will wipe away whatever we had set with the 'addFamily' call in the previous step resulting in an empty column when queried.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira