[ 
https://issues.apache.org/jira/browse/HIVE-4995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13730992#comment-13730992
 ] 

Hudson commented on HIVE-4995:
------------------------------

FAILURE: Integrated in Hive-trunk-hadoop2-ptest #48 (See 
[https://builds.apache.org/job/Hive-trunk-hadoop2-ptest/48/])
HIVE-4995: select * may incorrectly return empty fields with hbase-handler 
(Swarnim Kulkarni via Brock Noland) (brock: 
http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1510973)
* 
/hive/trunk/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHBaseTableInputFormat.java
* 
/hive/trunk/hbase-handler/src/test/queries/positive/hbase_binary_map_queries_prefix.q
* 
/hive/trunk/hbase-handler/src/test/results/positive/hbase_binary_map_queries_prefix.q.out

                
> 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
>             Fix For: 0.12.0
>
>         Attachments: HIVE-4995.1.patch.txt, 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

Reply via email to