Github user fpompermaier commented on a diff in the pull request:

    https://github.com/apache/incubator-flink/pull/172#discussion_r19740015
  
    --- Diff: 
flink-addons/flink-hbase/src/main/java/org/apache/flink/addons/hbase/common/HBaseResult.java
 ---
    @@ -21,10 +21,15 @@
     
     import java.io.IOException;
     
    +import org.apache.flink.api.java.typeutils.runtime.DataInputViewStream;
     import org.apache.flink.core.memory.DataInputView;
     import org.apache.flink.core.memory.DataOutputView;
    +import org.apache.flink.core.memory.DataOutputViewStream;
     import org.apache.flink.types.Value;
     import org.apache.hadoop.hbase.client.Result;
    +import org.apache.hadoop.hbase.mapreduce.ResultSerialization;
    +import org.apache.hadoop.io.serializer.Deserializer;
    +import org.apache.hadoop.io.serializer.Serializer;
     
     public class HBaseResult implements Value {
    --- End diff --
    
    I tried to remove HBaseResult and HBaseKey using directly 
Tuple2<ImmutableBytesWritable, Result> as you suggested but this does not work 
because of Avro serialization..at the moment I was trying to use the following:
    
    @Override
        public Tuple2<ImmutableBytesWritable, Result> nextRecord(
                        Tuple2<ImmutableBytesWritable, Result> reuse) throws 
IOException {
                if (this.tableRecordReader == null)
                {
                        throw new IOException("No table record reader 
provided!");
                }
    
                try {
                        if (this.tableRecordReader.nextKeyValue())
                        {
                                Result currentValue = 
tableRecordReader.getCurrentValue();
                                currentValue.setExists(Boolean.TRUE);//fix null 
pointer in avro serialization
                                ImmutableBytesWritable currentKey = 
tableRecordReader.getCurrentKey();
                                reuse.setField(currentKey, 0);
                                reuse.setField(currentValue, 1);
                                return reuse;
                        } else
                        {
                                this.endReached = true;
                        }
                } catch (InterruptedException e) {
                        LOG.error("Table reader has been interrupted", e);
                        throw new IOException(e);
                }
                return null;
        }
    
    How do I have to proceed?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to