python连接impala时,执行SQL报错expecting list of size 2 for struct args
这个错误困扰了好久,因为集群有多台,暂放到其他几台机器上执行了SQL操作,一直在找解决方法,无意间得到真传,喜出望外啊
报错信息:
Traceback (most recent call last):
File "b.py", line 3, in <module>
cur=conn.cursor()
File "/usr/local/python2.7/lib/python2.7/site-packages/impyla-v0.14.0-py2.7.egg/impala/hiveserver2.py", line 125, in cursor
session = self.service.open_session(user, configuration)
File "/usr/local/python2.7/lib/python2.7/site-packages/impyla-v0.14.0-py2.7.egg/impala/hiveserver2.py", line 995, in open_session
resp = self._rpc('OpenSession', req)
File "/usr/local/python2.7/lib/python2.7/site-packages/impyla-v0.14.0-py2.7.egg/impala/hiveserver2.py", line 923, in _rpc
response = self._execute(func_name, request)
File "/usr/local/python2.7/lib/python2.7/site-packages/impyla-v0.14.0-py2.7.egg/impala/hiveserver2.py", line 940, in _execute
return func(request)
File "/usr/local/python2.7/lib/python2.7/site-packages/impyla-v0.14.0-py2.7.egg/impala/_thrift_gen/TCLIService/TCLIService.py", line 174, in OpenSession
self.send_OpenSession(req)
File "/usr/local/python2.7/lib/python2.7/site-packages/impyla-v0.14.0-py2.7.egg/impala/_thrift_gen/TCLIService/TCLIService.py", line 181, in send_OpenSession
args.write(self._oprot)
File "/usr/local/python2.7/lib/python2.7/site-packages/impyla-v0.14.0-py2.7.egg/impala/_thrift_gen/TCLIService/TCLIService.py", line 1069, in write
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
TypeError: expecting list of size 2 for struct args
解决方法:
[root@cdh3 tmp]# pip install thrift==0.9.3
Looking in indexes: http://mirrors.tencentyun.com/pypi/simple
Collecting thrift==0.9.3
Downloading http://mirrors.tencentyun.com/pypi/packages/ae/58/35e3f0cd290039ff862c2c9d8ae8a76896665d70343d833bdc2f748b8e55/thrift-0.9.3.tar.gz
Installing collected packages: thrift
Found existing installation: thrift 0.13.0
Uninstalling thrift-0.13.0:
Successfully uninstalled thrift-0.13.0
Running setup.py install for thrift ... done
Successfully installed thrift-0.9.3
原因:应该是thrift模块版本的问题
Thrift是Facebook于2007年开发的跨语言的rpc服框架,提供多语言的编译功能,并提供多种服务器工作模式;用户通过Thrift的IDL(接口定义语言)来描述接口函数及数据类型,然后通过Thrift的编译环境生成各种语言类型的接口文件,用户可以根据自己的需要采用不同的语言开发客户端代码和服务器端代码。
python连接impala时,执行SQL报错expecting list of size 2 for struct args的更多相关文章
- 转 sqlplus执行sql报错:ORA-01756:
1.sqlplus执行sql报错:ORA-01756: quoted string not properly terminated 分类: 技术 在SQLPLUS中执行SQL文件时 ...
- 数据库执行sql报错Got a packet bigger than 'max_allowed_packet' bytes及重启mysql
准备在mysql上使用数据库A,但mysql5经过重装后,上面的数据库已丢失,只得通过之前备份的A.sql重新生成数据库A. 1.执行sql报错 在执行A.sql的过程中,出现如下错误:Got a p ...
- Python连接MySQL数据库执行sql语句时的参数问题
由于工作需要,今天写了一个Python小脚本,其中需要连接MySQL数据库,在执行sql命令时需要传递参数,结果出问题了.在网上查了一下,发现有以下几种方式传递参数: 一.直接把sql查询语句完整写入 ...
- 执行 sql 报错未缓冲查询,错误码 2014
sql语句为 SELECT COUNT(id) AS tp_count FROM `tableName` WHERE `status` = 0 AND `source` = 1 AND ( `end_ ...
- MySQL - 执行sql报错USING BTREE
问题与分析 在执行sql文件时发现报错如下: You have an error in your SQL syntax; check the manual that corresponds to yo ...
- Navicat连接MySQL8+时出现2059报错
当我们连接时,会报2059错误 在用navicat连接MySQL8+时会出现2059错误,这是由于新版本的MySQL使用的是caching_sha2_password验证方式,但此时的navicat还 ...
- 多线程执行sql报错处理
pymysql多线程访问数据库报错:Packet sequence number wrong - got 7 expected 2 原文:https://www.cnblogs.com/heiao10 ...
- Oracle执行SQL报错ORA-00922
问题描述: 对Oracle数据库执行序列化脚本出错,ora-00922 missing or invalid option #无效的选项 问题解决: 对于set define off --这个是sq ...
- ui自动化测试数据复原遇到的坑——2、python连接informix时pytest报致命错误Windows fatal exception: access violation
python连接informix只能通过jdbc(需要先部署java环境.我试过到IBM上下载ODBC但结局是失败的),在执行pytest时发现有一串报错(大致是下面的这样): Windows fat ...
随机推荐
- java大文件下载+断点续传
java两台服务器之间,大文件上传(续传),采用了Socket通信机制以及JavaIO流两个技术点,具体思路如下: 实现思路:1.服:利用ServerSocket搭建服务器,开启相应端口,进行长连接操 ...
- Laravel 别名Redis 与 Redis 扩展冲突
use Redis; //通过别名引用会报错 今天尝试使用了 Laravel 的 redis 结果报了如下错误. Non-static method Redis::xxx() cannot be ca ...
- Python3之返回函数
参考:https://www.cnblogs.com/mzc1997/p/7641995.html Python中函数不仅可以作为参数还可以作为结果返回 >>> def pro1(c ...
- idea的enable auto-import/内存设置
设置pom.xml依赖的自动导入 设置idea的memory heap On the Help menu, click Edit Custom VM Options. Set the -Xmx opt ...
- 持续集成 Jenkins +Gitlab + SSH 自动发布 HTML 代码
目录 一.整体流程 二.Jenkins 配置 2.1.首先安装插件 2.2.配置目标服务器 2.3.创建 job 2.4.配置 gitlab 触发 三.改进 一.整体流程 二.Jenkins 配置 2 ...
- CenOS 7 安装JDK
1.输入安装命令 yum install java-1.8.0-openjdk-devel.x86_64
- windows服务器入门 php的安装
下载PHP安装包(下载地址: http://windows.php.net/download/ ),本文档以5.3版本为例,选择如下图对应的安装包: 下载完成后进行安装PHP,需要选择Web服务时,选 ...
- PyCharm Community Edition编辑Python查看数据库
描述:利用PyCharm Community Edition社区版本的时候无法查看数据库 解决方法如下: 点击File之后选择setting 点击setting之后出现的画面上面选择Plugins,之 ...
- Windows删除某服务
win+R然后cmd进入命令窗口 sc delete 服务名
- Elasticsearch集群搭建笔记(elasticsearch-6.3.0)
# 检查Java版本 java -version # 安装Elasticsearch,所有节点均安装并解压 wget https://artifacts.elastic.co/downloads/el ...