我正在使用Apache Phoenix并尝试创建架构。
以下是使用的版本(伪分布式安装)
我很想创建模式
hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://{{HOST}}:8020/hbase</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/testuser/zookeeper</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>{{HOST}}</value>
</property>
<property>
<name>zookeeper.znode.parent</name>
<value>/hbase</value>
<source>hbase-site.xml</source>
</property>
<property>
<name>phoenix.schema.isNamespaceMappingEnabled</name>
<value>true</value>
</property>
</configuration>
出现以下错误
0: jdbc:phoenix:hdp1.hw.com:2181> !tables
+------------+--------------+-------------+---------------+----------+---------+
| TABLE_CAT | TABLE_SCHEM | TABLE_NAME | TABLE_TYPE | REMARKS | TYPE_NA |
+------------+--------------+-------------+---------------+----------+---------+
| | SYSTEM | CATALOG | SYSTEM TABLE | | |
| | SYSTEM | FUNCTION | SYSTEM TABLE | | |
| | SYSTEM | SEQUENCE | SYSTEM TABLE | | |
| | SYSTEM | STATS | SYSTEM TABLE | | |
+------------+--------------+-------------+---------------+----------+---------+
0: jdbc:phoenix:hdp1.hw.com:2181> create schema test;
Error: ERROR 601 (42P00): Syntax error. Encountered "schema" at line 1, column 8. (state=42P00,code=601)
org.apache.phoenix.exception.PhoenixParserException: ERROR 601 (42P00): Syntax error. Encountered "schema" at line 1, column 8.
at org.apache.phoenix.exception.PhoenixParserException.newException(PhoenixParserException.java:33)
at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:111)
at org.apache.phoenix.jdbc.PhoenixStatement$PhoenixStatementParser.parseStatement(PhoenixStatement.java:1185)
at org.apache.phoenix.jdbc.PhoenixStatement.parseStatement(PhoenixStatement.java:1268)
at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1339)
at sqlline.Commands.execute(Commands.java:822)
at sqlline.Commands.sql(Commands.java:732)
at sqlline.SqlLine.dispatch(SqlLine.java:808)
at sqlline.SqlLine.begin(SqlLine.java:681)
at sqlline.SqlLine.start(SqlLine.java:398)
at sqlline.SqlLine.main(SqlLine.java:292)
Caused by: NoViableAltException(98@[])
at org.apache.phoenix.parse.PhoenixSQLParser.oneStatement(PhoenixSQLParser.java:650)
at org.apache.phoenix.parse.PhoenixSQLParser.statement(PhoenixSQLParser.java:500)
at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:108)
... 9 more
但是我可以使用phoenix 4.14.0
以相同的配置成功创建模式。