Return-Path: Delivered-To: apmail-lucene-hadoop-dev-archive@locus.apache.org Received: (qmail 66272 invoked from network); 12 Sep 2007 23:17:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Sep 2007 23:17:01 -0000 Received: (qmail 89973 invoked by uid 500); 12 Sep 2007 23:16:54 -0000 Delivered-To: apmail-lucene-hadoop-dev-archive@lucene.apache.org Received: (qmail 89870 invoked by uid 500); 12 Sep 2007 23:16:53 -0000 Mailing-List: contact hadoop-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-dev@lucene.apache.org Delivered-To: mailing list hadoop-dev@lucene.apache.org Received: (qmail 89861 invoked by uid 99); 12 Sep 2007 23:16:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Sep 2007 16:16:53 -0700 X-ASF-Spam-Status: No, hits=-98.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Sep 2007 23:16:52 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 37ACF71417D for ; Wed, 12 Sep 2007 16:16:32 -0700 (PDT) Message-ID: <33002001.1189638992224.JavaMail.jira@brutus> Date: Wed, 12 Sep 2007 16:16:32 -0700 (PDT) From: "Izaak Rubin (JIRA)" To: hadoop-dev@lucene.apache.org Subject: [jira] Issue Comment Edited: (HADOOP-1789) [hbaseshell] output formatting In-Reply-To: <31879734.1188276210964.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-1789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526930 ] irubin edited comment on HADOOP-1789 at 9/12/07 4:14 PM: -------------------------------------------------------------- I feel I should clarify and give an example of how the formatting of my patch differs from the previous formatting styles. At present if the data for a cell was too wide, the ascii table would wrap the contents of the cell to the next line. Natively FreeMarker does not have support for wrapping. While we could add a wrapping method other formats we'd like to support probably won't want to wrap at all (output with no formatting -- the empty-template -- or xml and html). So, for now, this patch does not wrap. Instead, the template looks at the width of the column and the length of the cell data, and if the cell data is too wide it is truncated and followed by "...". Here is an example: {code} create sample_table columnfamilies('cfam:'); insert sample_table ('cfam:') values('abcdefghijklmnopqrstuvwxyz') where row='alphabet'; select sample_table where row='alphabet'; +------+----------------------+----------------------+----------------------+ | No. | Row | Column | Cell | +------+----------------------+----------------------+----------------------+ | 1 | alphabet | cfam | abcdefghijklmnopq... | +------+----------------------+----------------------+----------------------+ {code} was (Author: irubin): I feel I should clarify and give an example of how the formatting of my patch differs from the previous formatting styles. At present if the data for a cell was too wide, the ascii table would wrap the contents of the cell to the next line. This was problematic for a variety of reasons and was not working properly. With the changes from my patch, there is no longer line wrapping; instead, the template looks at the width of the column and the length of the cell data, and if the cell data is too wide it is truncated and followed by "...". Here is an example: {code} create sample_table columnfamilies('cfam:'); insert sample_table ('cfam:') values('abcdefghijklmnopqrstuvwxyz') where row='alphabet'; select sample_table where row='alphabet'; +------+----------------------+----------------------+----------------------+ | No. | Row | Column | Cell | +------+----------------------+----------------------+----------------------+ | 1 | alphabet | cfam | abcdefghijklmnopq... | +------+----------------------+----------------------+----------------------+ {code} > [hbaseshell] output formatting > ------------------------------ > > Key: HADOOP-1789 > URL: https://issues.apache.org/jira/browse/HADOOP-1789 > Project: Hadoop > Issue Type: New Feature > Components: contrib/hbase > Reporter: stack > Priority: Minor > Attachments: console_templates.patch > > > hbaseshell currently outputs results using an ascii table. > This issue is about the hbaseshell offering a number of output formats beyond plain ascii table. It would be grand if output formatting was pluggable so folks could add new ones as they saw fit. > Currently, there is a painful need for unadorned output so folks can do a 'select page:content from webrepository where row="http://apache.com/index.html"; and they get back the page content only. Other output formats might be: csv, xml, or (x)html > Other related things to consider, but probably not as part of this issue, is that if we output xml, then we should probably have a sympathetic input parser for xml files (similar for csv). Let this issue just be about formatting (another issue can be done to add pluggable input parsers). Where the output lands should also be done in another issue: i.e. dependent on the command, output probably default to stdout but folks should be able to designate an output file (and target filesystem) as in hdfs://master.hdfsnode.com:8990/output/dump.txt or file:///tmp/dump.txt or s3://...., etc. > This issue is an outgrowth of HADOOP-1720 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.