操作系统:centos 7.4.1708
python:3.6版
异丙基==0.14.0
节俭==0.3.9
我有一个用例:
创建表
添加分区
插入值
删除分区(删除旧日期)
创建分区
插入值
在第六步我出错了 thriftpy.transport.TTransportException: TTransportException(type=4, message='TSocket read 0 bytes')
测试:
class TestExecution:
SQL_LIST = [
"create schema if not exists test",
"drop table if exists test.test_table",
"""
create table test.test_table(
id string not null,
tran_time bigint not null,
primary key (tran_time, id)
)
partition by range(tran_time) (partition 0 <= values <= 1262304000) -- till 2010-01-01
stored as kudu
"""
]
INSERT = "insert into test.test_table (id, tran_time) values('1', 1577836800)"
DROP = "alter table test.test_table drop if exists range partition 1577836800 <= values < 1577923200"
ADD = "alter table test.test_table add if not exists range partition 1577836800 <= values < 1577923200"
@classmethod
def setup_class(cls):
sql_runner.execute_sql_list(cls.SQL_LIST)
def test_remove_old_data(self):
sql_runner.execute_sql(self.ADD)
sql_runner.execute_sql(self.INSERT)
sql_runner.execute_sql(self.DROP)
sql_runner.execute_sql(self.ADD)
sql_runner.execute_sql(self.INSERT)
回溯:
hiveserver2.py 946 ERROR Failed to open transport (tries_left=3)
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/impala/hiveserver2.py", line 940, in _execute
return func(request)
File "/usr/lib64/python3.6/site-packages/thriftpy/thrift.py", line 198, in _req
return self._recv(_api)
File "/usr/lib64/python3.6/site-packages/thriftpy/thrift.py", line 210, in _recv
fname, mtype, rseqid = self._iprot.read_message_begin()
File "/usr/lib64/python3.6/site-packages/thriftpy/protocol/binary.py", line 372, in read_message_begin
self.trans, strict=self.strict_read)
File "/usr/lib64/python3.6/site-packages/thriftpy/protocol/binary.py", line 164, in read_message_begin
sz = unpack_i32(inbuf.read(4))
File "/usr/lib64/python3.6/site-packages/thriftpy/transport/__init__.py", line 32, in read
return readall(self._read, sz)
File "/usr/lib64/python3.6/site-packages/thriftpy/transport/__init__.py", line 14, in readall
chunk = read_fn(sz - have)
File "/usr/lib64/python3.6/site-packages/thriftpy/transport/buffered/__init__.py", line 39, in _read
self._rbuf = BytesIO(self._trans.read(max(sz, self._buf_size)))
File "/usr/lib64/python3.6/site-packages/thriftpy/transport/socket.py", line 125, in read
message='TSocket read 0 bytes')
thriftpy.transport.TTransportException: TTransportException(type=4, message='TSocket read 0 bytes')
你知道为什么失败了吗?
暂无答案!
目前还没有任何答案,快来回答吧!