hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anoop John <anoop.hb...@gmail.com>
Subject Re: HBase- Duplicate Values When Adding Column
Date Sun, 13 Jul 2014 05:37:46 GMT
If you use append(), this will be the way the values will get saved to
Cell.  If you want to get it as mutiple KVs  then store it as multiple
versions to a Cell.  Use Put only each time.  Make sure the HCD is set with
enough number of max versions.  HCD#setMaxVersions(int).  When reading also
, set Scan#setMaxVersions()

-Anoop-

On Sun, Jul 13, 2014 at 9:54 AM, Ted Yu <yuzhihong@gmail.com> wrote:

> 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