[ 
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.

Reply via email to