You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Lalit Jadhav <la...@nciportal.com> on 2017/08/29 03:33:24 UTC

Difference in hbase shell and java API

When I query on *hbase shell *and try to scan similar records using *Java
API* I get different results.

But again when I restart HBase then both the results matches. Can any body
explain why do I get different result for same rowkey.

*Note* : I have applied some Value-filter on scan in Java API. If I remove
this filter then also both the results matches.

-- 
Regards,
Lalit Jadhav
Network Component Private Limited.

Re: Difference in hbase shell and java API

Posted by Lalit Jadhav <la...@nciportal.com>.
Ted,

    I am using HBase-1.1.2 Version. Yes, It produced with small sample data

Sean,

    I am just using Bytes.toString(byte[]) to convert byte array to
stringified later converted to JSONObject.

On Wed, Aug 30, 2017 at 5:12 AM, Sean Busbey <bu...@apache.org> wrote:

> what are you using to decode / inspect the JSONObject in each case? or
> are you just looking at the bytes for the string representation?
>
> On Tue, Aug 29, 2017 at 3:34 AM, Lalit Jadhav
> <la...@nciportal.com> wrote:
> > Thank you for responding,
> >
> > No that what I meant, I am storing a JSONObject in Value. The row I scan
> in
> > Shell shows different JSONOject than one I got in Scan of Java API.
> >
> >
> > On Tue, Aug 29, 2017 at 9:38 AM, Ted Yu <yu...@gmail.com> wrote:
> >
> >> Typo: If the value-filter on scan was not applied in shell command
> >>
> >> On Mon, Aug 28, 2017 at 9:01 PM, Ted Yu <yu...@gmail.com> wrote:
> >>
> >> > If the value-filter on scan was applied in shell command, that
> explains
> >> > the difference.
> >> >
> >> > Cheers
> >> >
> >> > On Mon, Aug 28, 2017 at 8:33 PM, Lalit Jadhav <
> >> lalit.jadhav@nciportal.com>
> >> > wrote:
> >> >
> >> >> When I query on *hbase shell *and try to scan similar records using
> >> *Java
> >> >> API* I get different results.
> >> >>
> >> >> But again when I restart HBase then both the results matches. Can any
> >> body
> >> >> explain why do I get different result for same rowkey.
> >> >>
> >> >> *Note* : I have applied some Value-filter on scan in Java API. If I
> >> remove
> >> >> this filter then also both the results matches.
> >> >>
> >> >> --
> >> >> Regards,
> >> >> Lalit Jadhav
> >> >> Network Component Private Limited.
> >> >>
> >> >
> >> >
> >>
> >
> >
> >
> > --
> > Regards,
> > Lalit Jadhav
> > Network Component Private Limited.
>



-- 
Regards,
Lalit Jadhav
Network Component Private Limited.

Re: Difference in hbase shell and java API

Posted by Sean Busbey <bu...@apache.org>.
what are you using to decode / inspect the JSONObject in each case? or
are you just looking at the bytes for the string representation?

On Tue, Aug 29, 2017 at 3:34 AM, Lalit Jadhav
<la...@nciportal.com> wrote:
> Thank you for responding,
>
> No that what I meant, I am storing a JSONObject in Value. The row I scan in
> Shell shows different JSONOject than one I got in Scan of Java API.
>
>
> On Tue, Aug 29, 2017 at 9:38 AM, Ted Yu <yu...@gmail.com> wrote:
>
>> Typo: If the value-filter on scan was not applied in shell command
>>
>> On Mon, Aug 28, 2017 at 9:01 PM, Ted Yu <yu...@gmail.com> wrote:
>>
>> > If the value-filter on scan was applied in shell command, that explains
>> > the difference.
>> >
>> > Cheers
>> >
>> > On Mon, Aug 28, 2017 at 8:33 PM, Lalit Jadhav <
>> lalit.jadhav@nciportal.com>
>> > wrote:
>> >
>> >> When I query on *hbase shell *and try to scan similar records using
>> *Java
>> >> API* I get different results.
>> >>
>> >> But again when I restart HBase then both the results matches. Can any
>> body
>> >> explain why do I get different result for same rowkey.
>> >>
>> >> *Note* : I have applied some Value-filter on scan in Java API. If I
>> remove
>> >> this filter then also both the results matches.
>> >>
>> >> --
>> >> Regards,
>> >> Lalit Jadhav
>> >> Network Component Private Limited.
>> >>
>> >
>> >
>>
>
>
>
> --
> Regards,
> Lalit Jadhav
> Network Component Private Limited.

Re: Difference in hbase shell and java API

Posted by Lalit Jadhav <la...@nciportal.com>.
Thank you for responding,

No that what I meant, I am storing a JSONObject in Value. The row I scan in
Shell shows different JSONOject than one I got in Scan of Java API.


On Tue, Aug 29, 2017 at 9:38 AM, Ted Yu <yu...@gmail.com> wrote:

> Typo: If the value-filter on scan was not applied in shell command
>
> On Mon, Aug 28, 2017 at 9:01 PM, Ted Yu <yu...@gmail.com> wrote:
>
> > If the value-filter on scan was applied in shell command, that explains
> > the difference.
> >
> > Cheers
> >
> > On Mon, Aug 28, 2017 at 8:33 PM, Lalit Jadhav <
> lalit.jadhav@nciportal.com>
> > wrote:
> >
> >> When I query on *hbase shell *and try to scan similar records using
> *Java
> >> API* I get different results.
> >>
> >> But again when I restart HBase then both the results matches. Can any
> body
> >> explain why do I get different result for same rowkey.
> >>
> >> *Note* : I have applied some Value-filter on scan in Java API. If I
> remove
> >> this filter then also both the results matches.
> >>
> >> --
> >> Regards,
> >> Lalit Jadhav
> >> Network Component Private Limited.
> >>
> >
> >
>



-- 
Regards,
Lalit Jadhav
Network Component Private Limited.

Re: Difference in hbase shell and java API

Posted by Ted Yu <yu...@gmail.com>.
Typo: If the value-filter on scan was not applied in shell command

On Mon, Aug 28, 2017 at 9:01 PM, Ted Yu <yu...@gmail.com> wrote:

> If the value-filter on scan was applied in shell command, that explains
> the difference.
>
> Cheers
>
> On Mon, Aug 28, 2017 at 8:33 PM, Lalit Jadhav <la...@nciportal.com>
> wrote:
>
>> When I query on *hbase shell *and try to scan similar records using *Java
>> API* I get different results.
>>
>> But again when I restart HBase then both the results matches. Can any body
>> explain why do I get different result for same rowkey.
>>
>> *Note* : I have applied some Value-filter on scan in Java API. If I remove
>> this filter then also both the results matches.
>>
>> --
>> Regards,
>> Lalit Jadhav
>> Network Component Private Limited.
>>
>
>

Re: Difference in hbase shell and java API

Posted by Ted Yu <yu...@gmail.com>.
If the value-filter on scan was applied in shell command, that explains the
difference.

Cheers

On Mon, Aug 28, 2017 at 8:33 PM, Lalit Jadhav <la...@nciportal.com>
wrote:

> When I query on *hbase shell *and try to scan similar records using *Java
> API* I get different results.
>
> But again when I restart HBase then both the results matches. Can any body
> explain why do I get different result for same rowkey.
>
> *Note* : I have applied some Value-filter on scan in Java API. If I remove
> this filter then also both the results matches.
>
> --
> Regards,
> Lalit Jadhav
> Network Component Private Limited.
>