博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
pyhive -- thrift.transport.TTransport.TTransportException: TSocket read 0 bytes
阅读量:6035 次
发布时间:2019-06-20

本文共 1928 字,大约阅读时间需要 6 分钟。

Pyhive 远程连接hive出现问题:

from pyhive import hiveimport pandas as pd#Create Hive connection conn = hive.Connection(host="172.18.33.32", port=10000, username="hadoop", auth="NOSASL", database="log")# Read Hive table and Create pandas dataframedf = pd.read_sql("SELECT count(*) FROM record", conn)print(df.head())

错误:

Traceback (most recent call last):  File "HiveConnect.py", line 4, in 
conn = hive.Connection(host="172.18.33.32", port=10000, username="hadoop", auth="NOSASL") File "C:\Users\v-lijess\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyhive\hive.py", line 168, in __init__ response = self._client.OpenSession(open_session_req) File "C:\Users\v-lijess\AppData\Local\Programs\Python\Python36-32\lib\site-packages\TCLIService\TCLIService.py", line 187, in OpenSession return self.recv_OpenSession() File "C:\Users\v-lijess\AppData\Local\Programs\Python\Python36-32\lib\site-packages\TCLIService\TCLIService.py", line 199, in recv_OpenSession (fname, mtype, rseqid) = iprot.readMessageBegin() File "C:\Users\v-lijess\AppData\Local\Programs\Python\Python36-32\lib\site-packages\thrift\protocol\TBinaryProtocol.py", line 148, in readMessageBegin name = self.trans.readAll(sz) File "C:\Users\v-lijess\AppData\Local\Programs\Python\Python36-32\lib\site-packages\thrift\transport\TTransport.py", line 60, in readAll chunk = self.read(sz - have) File "C:\Users\v-lijess\AppData\Local\Programs\Python\Python36-32\lib\site-packages\thrift\transport\TTransport.py", line 162, in read self.__rbuf = BufferIO(self.__trans.read(max(sz, self.__rbuf_size))) File "C:\Users\v-lijess\AppData\Local\Programs\Python\Python36-32\lib\site-packages\thrift\transport\TSocket.py", line 132, in read message='TSocket read 0 bytes')thrift.transport.TTransport.TTransportException: TSocket read 0 bytes

解决方案:hive-site.xml 增加下面属性,然后重启hive

 

转载于:https://www.cnblogs.com/Jesse-Li/p/8933776.html

你可能感兴趣的文章
Vue2.5笔记:Vue的实例与生命周期
查看>>
论JVM爆炸的几种姿势及自救方法
查看>>
联合体、结构体简析
查看>>
使用throw让服务器端与客户端进行数据交互[Java]
查看>>
java反射与代理
查看>>
深度分析Java的ClassLoader机制(源码级别)
查看>>
微服务架构选Java还是选Go - 多用户负载测试
查看>>
我的友情链接
查看>>
Javascript中的异步如何实现回调
查看>>
halcon算子介绍
查看>>
挖掘你不知道的windowsxp中的带宽潜能
查看>>
Software Engineering 招聘要求
查看>>
【转载】InstallAnyWhere自动化制作安装包的知识
查看>>
69、iSCSI共享存储配置实战
查看>>
文本编程
查看>>
乔布斯走了。你还期待苹果吗?
查看>>
优先级
查看>>
Tomcat与Web服务器、应用服务器的关系
查看>>
用DFS实现全排列 & 八皇后问题
查看>>
深度学习博客
查看>>