Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
impala dbapi python3 thriftpy2 hiveserver2无法在查询配置单元数据库后从游标读取_Python_Hive_Impala - Fatal编程技术网

impala dbapi python3 thriftpy2 hiveserver2无法在查询配置单元数据库后从游标读取

impala dbapi python3 thriftpy2 hiveserver2无法在查询配置单元数据库后从游标读取,python,hive,impala,Python,Hive,Impala,使用Python3.8,尝试连接到配置单元并运行查询,但收到以下错误 当执行查询并尝试从游标读取时,收到以下错误 ../connector/Connector.py:129: in perform_query print(cursor.description) ../venv/lib/python3.8/site-packages/impala/hiveserver2.py:187: in description schema = self._last_operation.get

使用Python3.8,尝试连接到配置单元并运行查询,但收到以下错误 当执行查询并尝试从游标读取时,收到以下错误

../connector/Connector.py:129: in perform_query
    print(cursor.description)
../venv/lib/python3.8/site-packages/impala/hiveserver2.py:187: in description
    schema = self._last_operation.get_result_schema()
../venv/lib/python3.8/site-packages/impala/hiveserver2.py:1265: in get_result_schema
    resp = self._rpc('GetResultSetMetadata', req)
../venv/lib/python3.8/site-packages/impala/hiveserver2.py:992: in _rpc
    response = self._execute(func_name, request)
../venv/lib/python3.8/site-packages/impala/hiveserver2.py:1009: in _execute
    return func(request)
../venv/lib/python3.8/site-packages/thriftpy2/thrift.py:219: in _req
    return self._recv(_api)
../venv/lib/python3.8/site-packages/thriftpy2/thrift.py:231: in _recv
    fname, mtype, rseqid = self._iprot.read_message_begin()
../venv/lib/python3.8/site-packages/thriftpy2/protocol/binary.py:372: in read_message_begin
    api, ttype, seqid = read_message_begin(
../venv/lib/python3.8/site-packages/thriftpy2/protocol/binary.py:165: in read_message_begin
    sz = unpack_i32(inbuf.read(4))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

buf = b''

    def unpack_i32(buf):
>       return struct.unpack("!i", buf)[0]
E       struct.error: unpack requires a buffer of 4 bytes
代码是

self.instance.conn = connect(host='host',
                                     port=10000, auth_mechanism='GSSAPI',
                                     user='username',
                                     password='password',
                                     kerberos_service_name='hive')


    def perform_query(self, query):
        try:
            cursor = self.instance.conn.cursor()
            cursor.execute(query)
            print(cursor.description)

            for row in cursor:
                print(row)