2

I'm trying to use Apache Phoenix to run SQL queries on HBase tables. Based on the official documetation, a schema need to be created for existing tables with the SQL query:

CREATE TABLE TABLE_NAME (....)

I tried to avoid this by directly connecting to an existing table (created with HBase API) through the phoenix API but I was getting exceptions. The thing is when Phoenix executes this query, it creates a lot of things on the table. For instance, in the tables section of the hbase dashboard, I can see the following meta-data added by phoenix to my table:

'QUOTES', {METHOD => 'table_att', coprocessor$1 => '|org.apache.phoenix.coprocessor.ScanRegionObserver|1|', coprocessor$2 => '|org.apache.phoenix.coprocessor.UngroupedAggregateRegionObserver|1|', coprocessor$3 => '|org.apache.phoenix.coprocessor.GroupedAggregateRegionObserver|1|', coprocessor$4 => '|org.apache.phoenix.coprocessor.ServerCachingEndpointImpl|1|', coprocessor$5 => '|org.apache.phoenix.hbase.index.Indexer|1073741823|index.builder=org.apache.phoenix.index.PhoenixIndexBuilder,org.apache.hadoop.hbase.index.codec.class=org.apache.phoenix.index.PhoenixIndexCodec'}, {NAME => '0', DATA_BLOCK_ENCODING => 'FAST_DIFF', KEEP_DELETED_CELLS => 'true'}

It sounds like pheonix is changing the meta information of the table (it creates some coprocessors and index builders), Is this gone create problems for production (interfer with code that uses HBase API)? if so how to avoid it?

4

1 回答 1

4

CREATE TABLE是的,当您执行 a或CREATE VIEW按照此处所述 时,Apache Phoenix 会将协处理器添加到底层 HBase 表的元数据中。这些不会干扰使用 HBase API 的代码,因为协处理器所做的任何处理仅在执行 API 调用的客户端设置 Phoenix 特定属性时才会触发。

对于 a Phoenix VIEW,仅进行这些元数据更改。对于 a Phoenix TABLE,除了这些元数据更改之外,还会向表的每一行添加一个空的 KeyValue。这样做是为了提高性能,并防止在所有列都设置为 null 时行“消失”。更多细节在这里

于 2014-09-06T23:54:53.660 回答