You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by 李維哲 <ke...@gmail.com> on 2019/08/26 06:11:40 UTC

How to print the entire data table according to the specific conditions in Apache HBase Shell

In the "scan" command in Apache HBase Shell, how to print the entire data
table according to the following conditions:

(1) Sort the printed data in ascending order of timestamp value

(2) How to distinguish whether the printed actual data value is an "empty
string" or a "space key"

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
不含病毒。www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Re: How to print the entire data table according to the specific conditions in Apache HBase Shell

Posted by OpenInx <op...@gmail.com>.
Hi
> (1) Sort the printed data in ascending order of timestamp value
Currently,  the hbase jruby scripts cannot meet your requirements now.  If
you really want this feature, you
may need to edit the *_scan_internal* method in
hbase-shell/src/main/ruby/hbase/table.rb.   say sort the cells
by your timestamp.

> (2) How to distinguish whether the printed actual data value is an "empty
string" or a "space key"
I see the ruby code:

    # Make a String of the passed kv
    # Intercept cells whose format we know such as the info:regioninfo in
hbase:meta
    def to_string(column, kv, maxlength = -1, converter_class = nil,
converter = nil)

Seems you can try to define your own converter to distinguish the space or
empty, by default the converter
will use the Bytes#toStringBinary method, so may you can also change
implementation of this method to meet
your requirement.

Thanks

On Tue, Aug 27, 2019 at 6:49 AM 李維哲 <ke...@gmail.com> wrote:

> In the "scan" command in Apache HBase Shell, how to print the entire data
> table according to the following conditions:
>
> (1) Sort the printed data in ascending order of timestamp value
>
> (2) How to distinguish whether the printed actual data value is an "empty
> string" or a "space key"
>
> <
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> >
> 不含病毒。www.avast.com
> <
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> >
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>