hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From y_823...@tsmc.com
Subject Re: [Indexed HBase] Can I add index in an existing table?
Date Fri, 26 Feb 2010 02:23:12 GMT
You can try my code to create a index in the existing table.

public void AddIdx2ExistingTable(String tablename,String
columnfamily,String idx_column) throws IOException {
            IndexedTableAdmin admin = null;
          admin = new IndexedTableAdmin(config);
          admin.addIndex(Bytes.toBytes(tablename), new
IndexSpecification(idx_column,
          Bytes.toBytes(columnfamily+":"+idx_column)));
}




Fleming Chiu(邱宏明)
707-6128
y_823910@tsmc.com
週一無肉日吃素救地球(Meat Free Monday Taiwan)




                                                                                         
                                                            
                      ChingShen                                                          
                                                            
                      <chingshenchen@gm        To:      hbase-user <hbase-user@hadoop.apache.org>
                                                    
                      ail.com>                 cc:      (bcc: Y_823910/TSMC)          
                                                               
                                               Subject: [Indexed HBase] Can I add index in
an existing table?                                         
                      2010/02/26 10:18                                                   
                                                            
                      AM                                                                 
                                                            
                      Please respond to                                                  
                                                            
                      hbase-user                                                         
                                                            
                                                                                         
                                                            
                                                                                         
                                                            




Hi,

I got http://issues.apache.org/jira/browse/HBASE-2037 that can create a new
table with index, but can I add index in an existing table?
Any code examples?

Thanks.

Shen




 --------------------------------------------------------------------------- 
                                                         TSMC PROPERTY       
 This email communication (and any attachments) is proprietary information   
 for the sole use of its                                                     
 intended recipient. Any unauthorized review, use or distribution by anyone  
 other than the intended                                                     
 recipient is strictly prohibited.  If you are not the intended recipient,   
 please notify the sender by                                                 
 replying to this email, and then delete this email and any copies of it     
 immediately. Thank you.                                                     
 --------------------------------------------------------------------------- 




Mime
View raw message