Apache phoenix:创建到现有hbase表的phoenix表映射

问题描述 投票:0回答:1

我确实有hbase表,并且为了SQL支持,我正在尝试探索是否可以创建apache phoenix表。

我想知道是否在现有的hbase表上创建phoenix表,它是否复制(或复制)hbase表中存在的数据,或者phoenix表只是链接到hbase中存在的现有数据?

我的菲尼克斯版本是<4.12.0,所以this error仍然适用于我的版本,因此无法在现有hbase表的顶部创建视图。

hbase phoenix
1个回答
1
投票

我们可以在现有Hbase表的顶部创建Phoenix表。它在内部使用Phoenix协处理器与phoenix表链接。

是,将复制数据。

请参见以下步骤执行相同的操作:

create 'DEV_HBASE:TestPhoneixIntegration','cf'
describe 'HBASE_PAS:TestPhoneixIntegration'

  Table HBASE_PAS:TestPhoneixIntegration is ENABLED                                                                                                                                                           
  HBASE_PAS:TestPhoneixIntegration                                                                                                                                                                            
  COLUMN FAMILIES DESCRIPTION                                                                                                                                                                                     
  {NAME => 'cf', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCAC
  HE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}                                                                                                                                                   
  1 row(s) in 0.0630 seconds

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

create table "DEV_HBASE"."TestPhoneixIntegration"(ROWKEY VARCHAR PRIMARY KEY , "cf"."name" VARCHAR);

SELECT * FROM "DEV_HBASE"."TestPhoneixIntegration";
+----------+-------+
|  ROWKEY  | name  |
+----------+-------+
| rowkey1  | John  |
+----------+-------+

--------------------------------------------------------
describe 'DEV_HBASE:TestPhoneixIntegration'
Table DEV_HBASE:TestPhoneixIntegration is ENABLED                                                                                                                                                           
    DEV_HBASE:TestPhoneixIntegration, {TABLE_ATTRIBUTES => {coprocessor$1 => '|org.apache.phoenix.coprocessor.ScanRegionObserver|805306366|', coprocessor$2 => '|org.apache.phoenix.coprocessor.UngroupedAggrega
    teRegionObserver|805306366|', coprocessor$3 => '|org.apache.phoenix.coprocessor.GroupedAggregateRegionObserver|805306366|', coprocessor$4 => '|org.apache.phoenix.coprocessor.ServerCachingEndpointImpl|80530636
    6|', coprocessor$5 => '|org.apache.phoenix.hbase.index.Indexer|805306366|org.apache.hadoop.hbase.index.codec.class=org.apache.phoenix.index.PhoenixIndexCodec,index.builder=org.apache.phoenix.index.PhoenixInde
    xBuilder'}                                                                                                                                                                                                      
COLUMN FAMILIES DESCRIPTION                                                                                                                                                                                     
{NAME => 'cf', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCAC
HE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}                                                                                                                                                   
1 row(s) in 0.0580 seconds
© www.soinside.com 2019 - 2024. All rights reserved.