Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3A63018E19 for ; Wed, 16 Sep 2015 17:06:38 +0000 (UTC) Received: (qmail 67302 invoked by uid 500); 16 Sep 2015 17:06:37 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 67216 invoked by uid 500); 16 Sep 2015 17:06:37 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 67204 invoked by uid 99); 16 Sep 2015 17:06:37 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Sep 2015 17:06:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id BDE42F3381 for ; Wed, 16 Sep 2015 17:06:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.026 X-Spam-Level: *** X-Spam-Status: No, score=3.026 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.046, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id hRa1fcWoDPCi for ; Wed, 16 Sep 2015 17:06:32 +0000 (UTC) Received: from mail-ig0-f173.google.com (mail-ig0-f173.google.com [209.85.213.173]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 89B2F205B3 for ; Wed, 16 Sep 2015 17:06:32 +0000 (UTC) Received: by igbni9 with SMTP id ni9so36002764igb.0 for ; Wed, 16 Sep 2015 10:06:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=j1cAHEonds61FRv6YczIPLGlk405/EznOb1JnuhVs2Y=; b=OesPBH/e++P6UfzJRkshj0tgTpysFZ0vx8qKkPLarMBH0jNm83sWkUd9MdNfvhScF8 1fil8oTOsf8ye/N40aTOFPctYIvpEVolAtC5pYZkXdwM81waVhO3KMGV/fvdFwP880hf ZhZKzwJ7+JB1bU4xl5rKK5XBmPf+ecPIY5X5osri+UzQx4t+lwewISh2ePKG70x8V6M8 bWngXYbzQ9OkvNt3fe8gM8hVRfZ5rH5d6KBeJS0tnkpE7ayt+0zp3n87DgUqng5KFanA q13W2dlqQuMTLl3PggR85M93ZSEMNOyKY9zk4cHZdNlZxaNbhWR94gPAMFdPMtTbdXsE bQXQ== MIME-Version: 1.0 X-Received: by 10.50.66.145 with SMTP id f17mr18376784igt.9.1442423186107; Wed, 16 Sep 2015 10:06:26 -0700 (PDT) Sender: saint.ack@gmail.com Received: by 10.64.1.50 with HTTP; Wed, 16 Sep 2015 10:06:25 -0700 (PDT) In-Reply-To: References: Date: Wed, 16 Sep 2015 10:06:25 -0700 X-Google-Sender-Auth: ktTz2dCI04X84XPfcnXqtClBf5o Message-ID: Subject: Re: formatter.rb not respect width > 2 columns From: Stack To: Stephen Jiang Cc: "dev@hbase.apache.org" Content-Type: multipart/alternative; boundary=047d7bdc19189fb32d051fe0517e --047d7bdc19189fb32d051fe0517e Content-Type: text/plain; charset=UTF-8 On Wed, Sep 16, 2015 at 9:50 AM, Stephen Jiang 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 --047d7bdc19189fb32d051fe0517e--