Getting detailed Impyla error message

不羁的心 提交于 2021-01-27 18:33:40

问题


When I execute a SQL statement in Impala using Python/Impyla, I am just getting an exception with a generic error message like ""Operation is in ERROR_STATE". How do I get more detailed information about the error that occurred?


回答1:


The cursor object has a _last_operation field that can be used to get more detailed information. E.g.

        try:
            cur.execute(sql)  
        except Exception, e:
            op = cur._last_operation
            abort(400,"ERROR: %s"%op.get_log())

Output might be:

Complete (0 out of 0)
Error while flushing Kudu session
Already present: key already present


来源:https://stackoverflow.com/questions/36760236/getting-detailed-impyla-error-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!