We are using phoenix layer on top of Hbase table & created hbase tables via phoenix and appied snappy compression . is it possible to apply snappy compression or any compression on phoenix seconday index tables also ? if yes ,could you please share the syntax to use . Thanks .
While creating a new secondary index for a table, we can use the command such as below to specify the compression type:
> create index INDEXNAME on SCHEMA.TABLENAME(COLUMN) COMPRESSION=snappy;
And to alter the compression for an existing index table, run the following command from phoenix (notice that the command is 'alter table' instead of alter index here)
> alter table SCHEMA.INDEXNAME SET COMPRESSION=snappy
Thanks @rmaruthiyodan . Please provide some more clarity for your reply . you have given 'alter table' instead of 'alter index', that is fine . you mentioned SCHEMA.INDEXNAME ,SCHEMA is related to table as i knew , Is it related to index s well ? I dont have ant SCHEMA for the table ,what will bethe default SCHEMA name ? Thanks
@srini Sorry, I missed to notice this question earlier. Yes, the schema is related to an index as well. If no schema is associated with a table then you would just use the table name or index name in the command as:
> alter table INDEXNAME SET COMPRESSION=snappy;
I hope that answers the question.