geomesa

How to read data from Geomesa HBase Table?


I have a curiosity to know what value Geomesa store in the HBase? What processing/conversion Geomesa does before storing data into HBase?

For example, If I do get for an Id on HBase directly, then I get the response-1, but for the same Id if I do geomesa-hbase export, then I get response-2. What type of conversion do I need to do if I directly want to read response-1? Is it a Kryo-serialized byte[]?

Response-1

COLUMN                                         CELL                                                                                                                                  
 d:                                            timestamp=1567139694958, value=\x02\x00\x00\x00`OSM-node-541692281\xB9\x01\x08\x03\xC0^\x87\x9D\x0A\xBC\x01L@G\xD9\xA0\x01\x92\xA77\x7F\xF8\x00\x00\x00\x00\x00\x00\x01\x00\x00\x01a\x9F\xA1\x80h\x821-\xB1testUse\xF2OS\xCD\x01\x00\x00\x00\x01B\xDF\xAE\xC3\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x05\x183<>@HKTU^                                                                                    
1 row(s) in 0.8870 seconds

Response-2:

id,key:String,*geom:Point:srid=4326,timestamp:Timestamp,version:String,uid:String,user:String,featureSource:String,nodeId:Long,"tags:Map[String,String]",changeset:Long,visible:Boolean
OSM-node-5416922819,OSM-node-5416922819,POINT (-122.1189600788104 47.7001955),2018-02-16T17:20:17.000Z,1,-1,testUser,OSM,5416922819,,0,false


Solution

  • HBase always stores values as byte[]. In this case, the value is a Kryo-serialized SimpleFeature. You can deserialize it using a GeoMesa serializer instance.