hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: how to create a Result object with some null value?
Date Wed, 27 Feb 2013 21:57:10 GMT
If you look at KeyValue, you would see the following:

  public KeyValue(final byte[] row, final byte[] family,

      final byte[] qualifier, final long timestamp, Type type) {

    this(row, family, qualifier, timestamp, type, null);

  }
Note the last parameter, null, is for value.

Cheers

On Wed, Feb 27, 2013 at 4:34 AM, bigdata <bigdatabase@outlook.com> wrote:

> Now I want to test HBase with mock Result object.In the map(), we get
> value like this:
>
>
>
>
>
>
>
>
> byte[] date = value.getValue(Bytes.toBytes("f"),
>                                         Bytes.toBytes("date"));
> Sometimes,  the byte[] date will be null because of null value in hbase.
> Now I want to create fake HBase object by using :
>
>
>
>
>
>
>
> new KeyValue(
>                                         Bytes.toBytes(rowkey),
>                                         Bytes.toBytes(family),
>                                         Bytes.toBytes(qualifier),
>                                         1,
>                                         Bytes.toBytes(value));
> But I can't set value to null to create KeyValue object.
> Anybody knows how to simulate this situation?
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message