通过pyodbc访问配置单元获取parseexception和额外的eof

nx7onnlm  于 2021-06-25  发布在  Hive
关注(0)|答案(0)|浏览(253)

python:3.6.8 pyodbc:4.0.27 os:ubuntu 18.04 db:hive 0.13 driver:hortonworks-odbc-driver-for-hive下载于http://public-repo-1.hortonworks.com/hdp/hive-odbc/2.1.2.1002/debian/hive-odbc-native_2.1.2.1002-2_amd64.deb
我可以和

pyodbc.connect('host=...', driver='...', 
                    HiveServerType=2,
                    port=10000,,
                    uid='username',
                    password='password',
                    AuthMech=3,
                    ssl=1,
                    AllowSelfSignedServerCert=1,
                    AutoCommit=1,
                    UseNativeQuery=1,
)

并获取光标。然后

cursor.execute('show databases')

退货

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
pyodbc.Error: ('HY000', "[HY000] [Hortonworks][Hardy] (80) Syntax or semantic analysis error thrown in server while execurint query. Error message from server: Error while compiling statement: FAILED: ParseException line 1:14 cannot recognize input near '<EOF>' '<EOF>' '<EOF>' (80) (SQLExecDirectW)")

('HY000', "[HY000] [Hortonworks][Hardy] (80) Syntax or semantic analysis error thrown in server while execurint query. Error message from server: Error while compiling statement: FAILED: ParseException line 1:14 cannot recognize input near '<EOF>' '<EOF>' '<EOF>' (80) (SQLExecDirectW)")
>>>

我相信我的用法有些地方是错误的。这使它完全无法使用。请帮帮我!谢谢。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题