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

Prasanth J commented on HIVE-4388:
----------------------------------

Hi Brock

I tested this patch with hive earlier and it looks good. I have a small 
suggestion. 

In ResultWritable and PutWritable, the readFields() and write() methods can be 
improved by making use of methods from ProtobufUtil.java in hbase. I noticed 
that write() method in ResultWritable iterates KeyValue pair list and 
serializes it to output buffer. Instead, the result object can be serialized 
using protobuf. The result object can be converted to Result proto using 
{code}ClientProtos.Result toResult(final Result result){code}
and the result proto object can be written to output buffer as byte array. The 
size of the serialized result proto object can be found using 
getSerializedSize() which can be written before writing the result proto. 

For deserializing this in readFields(), the serialized size can be read from 
the stream first. The subsequent size bytes can be read and passed to 
ClientProtos.Result.parseFrom() method which returns result proto. This result 
proto can then be converted to Result object using {code}Result toResult(final 
ClientProtos.Result proto){code}

Same thing can be done for PutWritable as well. The only difference will be put 
has to be converted to mutation proto in write() and mutation proto has to be 
converted to put in readFields().

I haven't tested this approach. But I think it should work.
                
> HBase tests fail against Hadoop 2
> ---------------------------------
>
>                 Key: HIVE-4388
>                 URL: https://issues.apache.org/jira/browse/HIVE-4388
>             Project: Hive
>          Issue Type: Bug
>          Components: HBase Handler
>            Reporter: Gunther Hagleitner
>            Assignee: Brock Noland
>         Attachments: HIVE-4388.patch, HIVE-4388.patch, HIVE-4388.patch, 
> HIVE-4388.patch, HIVE-4388.patch, HIVE-4388.patch, HIVE-4388-wip.txt
>
>
> Currently we're building by default against 0.92. When you run against hadoop 
> 2 (-Dhadoop.mr.rev=23) builds fail because of: HBASE-5963.
> HIVE-3861 upgrades the version of hbase used. This will get you past the 
> problem in HBASE-5963 (which was fixed in 0.94.1) but fails with: HBASE-6396.

--
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