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 ...
随机推荐
- PAT 甲级 1045 Favorite Color Stripe (30 分)(思维dp,最长有序子序列)
1045 Favorite Color Stripe (30 分) Eva is trying to make her own color stripe out of a given one. S ...
- Spring Boot使用JDBC方式连接MySQL
首先去spring官网下载一个名为test的Spring Boot项目模板:https://start.spring.io/ 然后在mysql中的testdb数据库中新建一张名为test_user的表 ...
- C# Newtonsoft.Json JObject 操作
C# Newtonsoft.Json JObject 操作举例 JArray j = new JArray(); JObject obj = new JObject( ") ); JObje ...
- react做的简单的购物车
###第一步 :首先电脑上已经安装react的脚手架 cnpm install create-react-app -g ###第二步 :创建项目 creact-react-app 项目 ...
- P1020 【导弹拦截】
题目连接嘤嘤嘤~~ 这个题目还是比较难的(至少对我来说是酱紫的嘤嘤嘤).. 第一问,看题解好像用的都是DP,但其实可以用二分,求最长不上升子序列,因为只要输出答案,不用输出方案,时间复杂度n leg( ...
- Ubuntu下搜狗拼音输入法打不出汉字的解决方法
问题 (1)Ubuntu下,搜狗拼音输入法能启动(系统托盘处有图标),但是打不出汉字,打字时选框不正常. 或者 (2)Deepin下,搜狗输入法无法启动,托盘处不显示图标,fcitx运行正常(这个可以 ...
- NLog文章系列—系列文章目录以及简要介绍
参考文章:http://www.cnblogs.com/dflying/archive/2006/12/04/581750.aspx
- ThinkPHP如何在控制器中调用命令
前段时间因为业务需求,使用TP的command开发了几个模块,期间测试一下在控制器中调用命令的方式,发现一些问题记录一下 官方文档: <?php namespace app\index\cont ...
- php-fpm,cgi,fast-cgi,nginx,php.ini,php-fpm.conf,nginx.conf
php-fpm.conf 是PHP-FPM特有的配置文件. php.ini 是所以php模式中必须的配置文件. 两者的区别是,php-fpm.conf 是PHP-FPM进程管理器的配置文件,php.i ...
- [转帖]详解shell脚本括号区别--$()、$「 」、$「 」 、$(()) 、「 」 、「[ 」]
详解shell脚本括号区别--$().$「 」.$「 」 .$(()) .「 」 .「[ 」] 原创 波波说运维 2019-07-31 00:01:00 https://www.toutiao.com ...