can not get error logs when running with async_=True

#482 · open · 1 comments

View on GitHub ↗

huwngnosleep

I am running pyhive cursor.execute with async_=True, but when my query got error and I tried to get error message with cursor.fetch_logs() it returned an empty list. Did i do anything wrong, here is my code: ``` cursor.execute(sql_query, async_=True) while True: # Get operation status status_code = cursor.poll().operationState status_name = OPERATION_STATES.get(status_code, f'UNKNOWN_STATE_{status_code}') _logger.info("Query status: %s", status_name) if status_code in [2, 3, 4]: _logger.info("Query completed with status: %s", status_name) break elif status_code == 5: error_message = cursor.fetch_logs() _logger.info("Query failed with error: %s", error_message) raise Exception(f"Query failed: {error_message}") ```

Comments

huwngnosleep

by the way, the reason for me to do this is: we have a very long run time query (more than 1 hour), then after 1 hour, hiveserver2 (actually we are using SparkThrift server) do not return the status to pyhive client, although that query might be executed successfully. So I have to poll query status periodically