[ 
https://issues.apache.org/jira/browse/HBASE-5251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13465029#comment-13465029
 ] 

stack commented on HBASE-5251:
------------------------------

[~sameerv] I took another look.  Does this patch not pervert the original 
intent of formatter?  Formatter was about how to format the results for a 
particular output whether console, html for a webpage, or in some distant 
future, some fancy gui.  This patch changes formatter to instead hold the 
outputting context: i.e. admin or row output.  Maybe thats fine since we're not 
exploiting the original intent.  But maybe rather than remove formatter, we 
should introduce introduce context beyond what we currently have -- footer, 
row, header -- to include whatever you need outputting count of rows.

Otherwise, nice patch.
                
> Some commands return "0 rows" when > 0 rows were processed successfully
> -----------------------------------------------------------------------
>
>                 Key: HBASE-5251
>                 URL: https://issues.apache.org/jira/browse/HBASE-5251
>             Project: HBase
>          Issue Type: Bug
>          Components: shell
>    Affects Versions: 0.90.5
>            Reporter: David S. Wang
>            Assignee: Sameer Vaishampayan
>            Priority: Minor
>              Labels: noob
>         Attachments: patch7.diff, patch8.diff, patch9.diff
>
>
> From the hbase shell, I see this:
> hbase(main):049:0> scan 't1'                    
> ROW                   COLUMN+CELL                                             
>   
>  r1                   column=f1:c1, timestamp=1327104295560, value=value      
>   
>  r1                   column=f1:c2, timestamp=1327104330625, value=value      
>   
> 1 row(s) in 0.0300 seconds
> hbase(main):050:0> deleteall 't1', 'r1'
> 0 row(s) in 0.0080 seconds                  <====== I expected this to read 
> "2 row(s)"
> hbase(main):051:0> scan 't1'           
> ROW                   COLUMN+CELL                                             
>   
> 0 row(s) in 0.0090 seconds
> I expected the deleteall command to return "1 row(s)" instead of 0, because 1 
> row was deleted.  Similar behavior for delete and some other commands.  Some 
> commands such as "put" work fine.
> Looking at the ruby shell code, it seems that formatter.footer() is called 
> even for commands that will not actually increment the number of rows 
> reported, such as deletes.  Perhaps there should be another similar function 
> to formatter.footer(), but that will not print out @row_count.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to