0

非同期モードで Hive クエリを実行している PyHive で奇妙な問題が発生しています。内部的には、PyHive は Thrift クライアントを使用してクエリを実行し、ログを取得します (実行ステータスと共に)。Hive クエリ (マップ/リデュース タスクなど) のログを取得できません。cursor.fetch_logs()空のデータ構造を返します

ここにコードスニペットがあります

rom pyhive import hive  # or import hive or import trino
from TCLIService.ttypes import TOperationState

def run():
    cursor = hive.connect(host="10.x.y.z", port='10003', username='xyz', password='xyz', auth='LDAP').cursor()
    cursor.execute("select count(*) from schema1.table1 where date = '2021-03-13' ", async_=True)
    status = cursor.poll(True).operationState
    print(status)
    while status in (TOperationState.INITIALIZED_STATE, TOperationState.RUNNING_STATE):
        logs = cursor.fetch_logs()
        for message in logs:
            print("running ")
            print(message)

        # If needed, an asynchronous query can be cancelled at any time with:
        # cursor.cancel()
        print("running ")
        status = cursor.poll().operationState

    print
    cursor.fetchall()

カーソルは operationState を正しく取得できますが、ログを取得できません。HiveServer2 側で構成する必要があるものはありますか?

前もって感謝します

4

1 に答える 1