使用Apache Phoenix(Schema)映射HBase表(NameSpace)

时间:2017-09-21 12:05:25

标签: namespaces hbase schema phoenix

我在命名空间test(np:test)下创建了一个名为np的HBase表,并加载了如下记录。

create 'np:test','cf' put 'np:test','1','cf:c1','99'

我也在凤凰城创建了一个架构'np'并创建了一个phoenix表来映射hbase,如下所示。 create schema 'np'; CREATE TABLE "test"(PK VARCHAR PRIMARY KEY, "np"."c1" VARCHAR);

能够通过HBase表扫描插入的数据,但不能通过Phoenix Table中的相同扫描。映射没有完成.. 除此之外,我还尝试创建如下视图 CREATE VIEW "test"(PK VARCHAR PRIMARY KEY, "np"."c1" VARCHAR); 获得

Error: ERROR 505 (42000): Table is read only. (state=42000,code=505) org.apache.phoenix.schema.ReadOnlyTableException: ERROR 505 (42000): Table is read only. at org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:1069) at org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1434) at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:2624) at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:1040) at org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:212) at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:393) at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:376) at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53) at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:374) at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:363) at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1707) at sqlline.Commands.execute(Commands.java:822) at sqlline.Commands.sql(Commands.java:732) at sqlline.SqlLine.dispatch(SqlLine.java:813) at sqlline.SqlLine.begin(SqlLine.java:686) at sqlline.SqlLine.start(SqlLine.java:398) at sqlline.SqlLine.main(SqlLine.java:291)

请帮助解决HBase-Phoenix表映射问题。 在此先感谢!

0 个答案:

没有答案