You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Stephen Jiang <sy...@gmail.com> on 2015/09/16 18:50:05 UTC

formatter.rb not respect width > 2 columns

It is interesting that in formatter.rb, if more than 2 columns, it would
not respect the width passed in.  Why is that?  I am thinking about change
it, but I'd like to know the reason behind it.

Or is it ok to keep this way, even the output is not ideal?

        if args.length == 1
          ...
        elsif args.length == 2
         ...
          end
        else
          # Print a space to set off multi-column rows
          print ' '
          first = true
          for e in args
            @out.print " " unless first
            first = false
            @out.print e
          end
         ...
        end

Re: formatter.rb not respect width > 2 columns

Posted by Stack <st...@duboce.net>.
On Wed, Sep 16, 2015 at 9:50 AM, Stephen Jiang <sy...@gmail.com>
wrote:

> It is interesting that in formatter.rb, if more than 2 columns, it would
> not respect the width passed in.  Why is that?  I am thinking about change
> it, but I'd like to know the reason behind it.
>
> Or is it ok to keep this way, even the output is not ideal?
>
>         if args.length == 1
>           ...
>         elsif args.length == 2
>          ...
>           end
>         else
>           # Print a space to set off multi-column rows
>           print ' '
>           first = true
>           for e in args
>             @out.print " " unless first
>             first = false
>             @out.print e
>           end
>          ...
>         end
>


Probably because two columns was all we ever needed: row key and then the
value and if only one value, then show it as one column. Have at it Stephen.

Ideally though formatter.rb would go away -- it is an awful hack -- and
we'd have a 'real' console results formatter that did a better job. When I
looked back then, all were incompatibly licensed. That may have changed
(this looks ok on cursory glance:
https://github.com/thedathoudarya/WAGU-data-in-table-view... or could we
hack in sqlline -- https://github.com/julianhyde/sqlline -- or some such..).

St.Ack