hadoop - how to read Null values in HBase java -


I am trying to retract a long value from the HBase table. But this specific column is giving NullPointerException while extracting the family.

Sample code snippet:

  long total_ size = 0; Total_size + = Bytes. Lyle (rr.gate value (bytes.times ("size"), bytes tooto ("size"));  

I have stored values ​​for long periods. Some vlaues of size are zero. I want to withdraw zero values ​​and assign them to zero at zero.

Please give me the appropriate code snippet.

Thank you.

This is because bytes. The lol () method does not check whether the retrieved byte [] is null and do not call it byte []. The length which will throw off your exception, you can try the following tasks:

  string length value = bytes. Toasting (rr.gate value (bytes.times ("size"), bytes toto ("size")); ("Size"), bytes. Titles ("size")): 0L);  

total_ size + = (long value! = Null? Bytes lol. (Or try

  {total_size + = bytes.toLong (rr) .getValue (bytes.times ("size"), bytes.times ("size"));} hold (NullPointerException e) {// no need to increase from a total size of 0}  

Comments