hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manaswini (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-13788) Shell commands do not support column qualifiers containing colon (:)
Date Wed, 18 Jan 2017 19:06:26 GMT

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

Manaswini commented on HBASE-13788:
-----------------------------------

Thank you [~busbey] & stack

I've played with the code and implemented the idea of adding a formatting directive as a separate
argument instead of passing it along the column qualifier. Below are a few examples for existing
and changed code - 

hbase(main):003:0> scan 'content3'
ROW                                           COLUMN+CELL                                
                                                                                      
 A:9223370612089311807:twtr:57013379882792140 column=x:twitter:username, timestamp=1484764832937,
value=BERITA & INFORMASI!                                                     
 9                                                                                       
                                                                                      
1 row(s)

With existing code (cf:qualifier:[CONVERTER])
hbase(main):003:0>  get 'content3','A:9223370612089311807:twtr:570133798827921409',{COLUMN
=> 'x:twitter:toInt'}
COLUMN                               CELL                                                
                                                     
 x:twitter                           timestamp=1484755000607, value=1111839305           
                                                     
1 row(s) in 0.0140 seconds

hbase(main):003:0> scan 'content3' ,{COLUMN => 'x:twitter:toInt'}
ROW                                  COLUMN+CELL                                         
                                                     
 A:9223370612089311807:twtr:57013379 column=x:twitter, timestamp=1484755000607, value=1111839305
                                              
 8827921409                                                                              
                                                     
1 row(s) in 0.4960 seconds

hbase(main):003:0> scan 'content3' ,{COLUMN => 'x:twitter:username'}
ROW                                  COLUMN+CELL                                         
                                                     

ERROR: undefined method `username' for class `#<Class:0x73e49c2>'

-------------

With changed code (separate FORMATTER tag)
hbase(main):017:0> get 'content3','A:9223370612089311807:twtr:570133798827921409',{COLUMN
=> ['x:twitter:username'] , FORMATTER => {'x:twitter:username'=>'toInt'}} 
COLUMN                                        CELL                                       
                                                                                      
 x:twitter:username                           timestamp=1484754351711, value=1111839305  
                                                                                      
1 row(s)

hbase(main):017:0>  scan 'content3',{COLUMN => ['x:twitter:username'] , FORMATTER =>
{'x:twitter:username'=>'toInt'}} 
ROW                                           COLUMN+CELL                                
                                                                                      
 A:9223370612089311807:twtr:57013379882792140 column=x:twitter:username, timestamp=1484764832937,
value=1111839305                                                              
 9                                                                                       
                                                                                      
1 row(s)

hbase(main):017:0>  scan 'content3',{COLUMN => ['x:twitter:username'] }
ROW                                           COLUMN+CELL                                
                                                                                      
 A:9223370612089311807:twtr:57013379882792140 column=x:twitter:username, timestamp=1484764832937,
value=BERITA & INFORMASI!                                                     
 9                                                                                       
                                                                                      

Does this look good? 

Once I get thumbs-up from stack, I shall build the patch, add test cases for get and scan
along with proper comments and send it over for code review.


> Shell commands do not support column qualifiers containing colon (:)
> --------------------------------------------------------------------
>
>                 Key: HBASE-13788
>                 URL: https://issues.apache.org/jira/browse/HBASE-13788
>             Project: HBase
>          Issue Type: Bug
>          Components: shell
>    Affects Versions: 0.98.0, 0.96.0, 1.0.0, 1.1.0
>            Reporter: Dave Latham
>            Assignee: Manaswini
>
> The shell interprets the colon within the qualifier as a delimiter to a FORMATTER instead
of part of the qualifier itself.
> Example from the mailing list:
> Hmph, I may have spoken too soon. I know I tested this at one point and
> it worked, but now I'm getting different results:
> On the new cluster, I created a duplicate test table:
> hbase(main):043:0> create 'content3', {NAME => 'x', BLOOMFILTER =>
> 'NONE', REPLICATION_SCOPE => '0', VERSIONS => '3', COMPRESSION =>
> 'NONE', MIN_VERSIONS => '0', TTL => '2147483647', BLOCKSIZE => '65536',
> IN_MEMORY => 'false', BLOCKCACHE => 'true'}
> Then I pull some data from the imported table:
> hbase(main):045:0> scan 'content', {LIMIT=>1,
> STARTROW=>'A:9223370612089311807:twtr:57013379'}
> ROW                                  COLUMN+CELL
> ....
> A:9223370612089311807:twtr:570133798827921408
> column=x:twitter:username, timestamp=1424775595345, value=BERITA &
> INFORMASI!
> Then put it:
> hbase(main):046:0> put
> 'content3','A:9223370612089311807:twtr:570133798827921408',
> 'x:twitter:username', 'BERITA & INFORMASI!'
> But then when I query it, I see that I've lost the column qualifier
> ":username":
> hbase(main):046:0> scan 'content3'
> ROW                                  COLUMN+CELL
>  A:9223370612089311807:twtr:570133798827921408 column=x:twitter,
>  timestamp=1432745301788, value=BERITA & INFORMASI!
> Even though I'm missing one of the qualifiers, I can at least filter on
> columns in this sample table.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message