【问题标题】:can not connect to phoenix using python phoenixdb library无法使用 python phoenixdb 库连接到 phoenix
【发布时间】:2016-08-10 12:34:28
【问题描述】:

我有与 HBase 集成的 Phoenix。 我正在尝试使用 pythondb 库从 python 代码访问 phoenix,并且我已经使用 QueryServer 启动了

bin/queryserver.py start

但是在连接语句之后我得到以下错误:

database_url = 'http://localhost:8765/'
conn = phoenixdb.connect(database_url, autocommit=True)

InternalError: ('Cannot find parser for', None, None, None)

这是来自日志的错误:

2016-08-10 14:24:07,987 警告 org.eclipse.jetty.server.HttpChannel:/ java.lang.IllegalArgumentException:找不到 at 的解析器 org.apache.calcite.avatica.remote.ProtobufTranslationImpl.getParserForRequest(ProtobufTranslationImpl.java:182) 在 org.apache.calcite.avatica.remote.ProtobufTranslationImpl.parseRequest(ProtobufTranslationImpl.java:239) 在 org.apache.calcite.avatica.remote.ProtobufHandler.decode(ProtobufHandler.java:42) 在 org.apache.calcite.avatica.remote.ProtobufHandler.decode(ProtobufHandler.java:28) 在 org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:95) 在 org.apache.calcite.avatica.remote.ProtobufHandler.apply(ProtobufHandler.java:38) 在 org.apache.calcite.avatica.server.AvaticaProtobufHandler.handle(AvaticaProtobufHandler.java:68) 在 org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) 在 org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) 在 org.eclipse.jetty.server.Server.handle(Server.java:497) 在 org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) 在 org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:245) 在 org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) 在 org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) 在 org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) 在 java.lang.Thread.run(Thread.java:745)

【问题讨论】:

  • 虽然我可以成功连接到 sql shell 使用:bin/sqlline-thin.py localhost:8765

标签: python phoenix


【解决方案1】:

问题是因为我使用的是 Phoenix 4.7,即使我已经使用

启动了服务器
./bin/queryserver.py start -Dphoenix.queryserver.serialization=JSON

删除 Phoenix 4.7 并安装 4.6 后可以成功建立与 python 的连接。

我希望有人会使用这个技巧 :) 谢谢!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-12-02
    • 1970-01-01
    • 1970-01-01
    • 2016-11-24
    • 2013-08-23
    • 1970-01-01
    • 2017-08-20
    • 1970-01-01
    相关资源
    最近更新 更多