Pyhive 远程连接hive出现问题:

from pyhive import hive
import 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 dataframe
df = pd.read_sql("SELECT count(*) FROM record", conn)
print(df.head())

错误:

Traceback (most recent call last):
File "HiveConnect.py", line 4, in <module>
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

pyhive -- thrift.transport.TTransport.TTransportException: TSocket read 0 bytes的更多相关文章

  1. thrift.transport.TTransport.TTransportException: Could not start SASL: Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found

    thrift.transport.TTransport.TTransportException: Could not start SASL: Error in sasl_client_start (- ...

  2. jdbc链接hive报错:java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransport

    写了个jdbc连接hive2的demo,结果报错:java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransport,实际 ...

  3. happybase(TSocket read 0 bytes)

    关于报错happybase 是使用python连接hbase的一个第三方库,目前基于thrift1 .在使用过程中经常碰到报错 TTransportException(type=4, message= ...

  4. hue集成hbase出现TSocket read 0 bytes

    解决办法:修改hbase的配置文件 添加以下配置 https://stackoverflow.com/questions/20415493/api-error-tsocket-read-0-bytes ...

  5. 调用thrift出现No handlers could be found for logger "thrift.transport.TSocket"

    1.问题 使用thrift版本为0.10,在0.8没有这个问题 其中ncTAgent是代码中封装的thrift接口的结构,在thrift服务端没有启动的时候,应该拋错为连接不到.但是拋错的堆栈输出之前 ...

  6. org.apache.thrift.transport.TTransportException: Could not create ServerSocket on address 0.0.0.0/0.0.0.0:9083.

    1.启动hive的过程中,[hadoop@slaver1 soft]$ hive --service metastore &错误如下所示: 原因:之前启动hive失败了,但是进程以及启动起来, ...

  7. MetaException(message:Could not connect to meta store using any of the URIs provided. Most recent failure: org.apache.thrift.transport.TTransportException: java.net.ConnectException: 拒绝连接 (Connection

    hive在hive-site.xml中配置hive.metastore.uris属性,后启动异常 hive异常 [fan@master hive-0.13.1-cdh5.3.6]$ bin/hive ...

  8. thrift之TTransport层的缓存传输类TBufferedTransport和缓冲基类TBufferBase

    本节主要介绍缓冲相关的传输类,缓存的作用就是为了提高读写的效率.Thrift在实现缓存传输的时候首先建立一个缓存的基类,然后需要实现缓存功能的类都可以直接从这个基类继承.下面就详细分析这个基类以及一个 ...

  9. HttpClient Received an unexpected EOF or 0 bytes from the transport stream

    请求https链接时报错,奇怪的是pc1正常,pc2异常 Unhandled Exception: System.AggregateException: One or more errors occu ...

随机推荐

  1. 24-Fibonacci(dfs+剪枝)

    http://acm.hdu.edu.cn/showproblem.php?pid=5167 Fibonacci Time Limit: 2000/1000 MS (Java/Others)    M ...

  2. 如何将.jpg图片 转换成.eps 格式图片

    在使用latex写作论文的时候,需要插入一些图片,但是往往有些图片不是eps格式的.虽然网上有如何插入jpg格式的图片方法,但是经过我实验后发现都不太管用.最后找到一个比较靠谱的方法,使用latx本身 ...

  3. K-D TREE算法原理及实现

    博客转载自:https://leileiluoluo.com/posts/kdtree-algorithm-and-implementation.html k-d tree即k-dimensional ...

  4. Linux 终端命令行提示符的艺术--PS1进阶

    话不多说,先瞅瞅我的命令行提示符(有点大): 图中命令行解释:┌[阳历日期/农历日期 时间]├[当前目录下目录数+当前目录下文件数][当前绝对目录]└[用户名@主机名-第几个终端 ╰_╯] 相关配置文 ...

  5. 数据库commit问题

    对数据库进行修改后,需要commit!---之前也是忘记commit导致数据库反应不过来.

  6. margin,CSS边距重叠

    CSS外边距叠加就是margin-collapse,边距合并指的是,当两个垂直外边距相遇时,它们将形成一个外边距,水平边 距永远不会重合. 重叠结果计算规则: 两个相邻的外边距都是正数时,折叠结果是它 ...

  7. Educational Codeforces Round 60 (Rated for Div. 2)D(思维,DP,快速幂)

    #include <bits/stdc++.h>using namespace std;const long long mod = 1e9+7;unordered_map<long ...

  8. 算法训练 最大的算式(DP)

    问题描述 题目很简单,给出N个数字,不改变它们的相对位置,在中间加入K个乘号和N-K-1个加号,(括号随便加)使最终结果尽量大.因为乘号和加号一共就是N-1个了,所以恰好每两个相邻数字之间都有一个符号 ...

  9. django 基础框架学习 (二)

    Django框架基础-02 Django缓存cookie 1.说明        当我们服务器在响应数据的同时,希望写⼊⼀些缓存数据到客户端        我们可以选择在响应的同时,将要写⼊到客户端的 ...

  10. Gym - 101845F 最大流

    The UN finals are here!, the coaches/ex-coaches team is creating a new exciting contest to select wh ...