You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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}")
The text was updated successfully, but these errors were encountered:
huwngnosleep
changed the title
can not get error logs when running with _async=True
can not get error logs when running with async_=True
Mar 26, 2025
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
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:
The text was updated successfully, but these errors were encountered: