使用pyhive连接hive时,python报错信息,
raceback (most recent call last):
File "/home/coco/.local/lib/python3.10/site-packages/thrift/transport/TSocket.py", line 150, in read
buff = self.handle.recv(sz)
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/coco/PycharmProjects/pythonProject/bdatat_processing/test.py", line 7, in <module>
conn=hive.Connection(host=host,port=port,username=user,database='mum_baby')
File "/home/coco/.local/lib/python3.10/site-packages/pyhive/hive.py", line 269, in __init__
self._transport.open()
File "/home/coco/.local/lib/python3.10/site-packages/thrift_sasl/__init__.py", line 93, in open
status, payload = self._recv_sasl_message()
File "/home/coco/.local/lib/python3.10/site-packages/thrift_sasl/__init__.py", line 112, in _recv_sasl_message
header = self._trans_read_all(5)
File "/home/coco/.local/lib/python3.10/site-packages/thrift_sasl/__init__.py", line 210, in _trans_read_all
return read_all(sz)
File "/home/coco/.local/lib/python3.10/site-packages/thrift/transport/TTransport.py", line 62, in readAll
chunk = self.read(sz - have)
File "/home/coco/.local/lib/python3.10/site-packages/thrift/transport/TSocket.py", line 164, in read
raise TTransportException(message="unexpected exception", inner=e)
thrift.transport.TTransport.TTransportException: unexpected exception
在hive.log当中,报错信息为
2024-06-03T10:47:33,894 ERROR [HiveServer2-Handler-Pool: Thread-42] server.TThreadPoolServer: Thrift error occurred during processing of message.
org.apache.thrift.protocol.TProtocolException: Missing version in readMessageBegin, old client?
at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:228) ~[hive-exec-3.1.3.jar:3.1.3]
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:27) ~[hive-exec-3.1.3.jar:3.1.3]
at org.apache.hive.service.auth.TSetIpAddressProcessor.process(TSetIpAddressProcessor.java:56) ~[hive-service-3.1.3.jar:3.1.3]
at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286) ~[hive-exec-3.1.3.jar:3.1.3]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_351]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_351]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_351]
不知道要怎么解决