hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: HBase- Duplicate Values When Adding Column
Date Sun, 13 Jul 2014 04:24:49 GMT
Looks like entry.getValue() represents longitude.
Do you see latitude in the cell ?

Cheers


On Thu, Jul 10, 2014 at 2:11 PM, Saeed Zareian <zareian@yorku.ca> wrote:

> I'm trying to store some location (latitude,longitude) values in HBase. I
> decided to add a column each time I have a new value from my HashMap of key
> and value pairs. My HashMap is like following:
>
> *{lat:43.7719802, lon:-79.5008048}* *(A sample JSon representation of
> Hashmap)*
>
> And here is my code:
>
> HTable table = new HTable(hBaseConfig, TableName);
> for (Map.Entry<String, String> entry : Columns.entrySet()) {
>                     Append a = new Append(rowKey);
>                     a.add(Bytes.toBytes("a"),
> Bytes.toBytes(entry.getKey()), Bytes.toBytes(entry.getValue()));
>                     table.append(a);
>     }
>
> But When I want to retrieve values, They are stored redundant. I mean they
> are glued together in one cell mutiple times for each value, like this:
> -79.5008048-79.5008048-79.5008048
>
> I'm using HBase 0.94.15-cdh4.7.0 library in my code.
>
> Does anybody know a clue for solving this problem?
> ​Thanks
>

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