4

I have some long string data in an hbase column and I want to use linux tools like grep, cut, sort, etc on the output of a scan.

Unfortunately, the hbase shell is formatting the output of the scan into visual columns in my terminal. This is nice for human readability but less-so for scripting.

Sample output:

 00000000-1111-2222-3333-444444444444  column=a:1, timestamp=151974600000, value="some really 
                                       long data that doesn't fit onto the terminal in one lin
                                       e"

I tried redirecting the output to a file, but it looks like the column value is wrapped there too.

Is there a way to tell the hbase shell not to insert this whitespace/formatting into my string value?

lmsurprenant
  • 1,723
  • 2
  • 14
  • 28

1 Answers1

-1

Not sure i get the whole question , some thing you can try is

echo "scan 'my_table',{COLUMNS=>'A:my_long_column'}" | hbase shell | grep "something"..

like the grep operation , you can pass it through other unit commands or through awk/sed etc.

Ramachandran.A.G
  • 4,788
  • 1
  • 12
  • 24
  • In the example i added, the problem is that a grep for "fit" would return only the second line instead of the entire result of interest. What I'd really like is to get my string value back without the newlines or extra whitespace formatting that is added by hbase shell. What I would settle for is some fancy bash/*nix commands for dealing with this type of formatted output... – lmsurprenant Apr 18 '18 at 04:43