cloudera / impyla

Python DB API 2.0 client for Impala and Hive (HiveServer2 protocol)
Apache License 2.0
727 stars 248 forks source link

Cannot access the query profile or error logs if it fails. #160

Open ishaan opened 8 years ago

ishaan commented 8 years ago

Use Case:

Run a query through impyla, and the query fails. I want to get some additional information, namely:

Problem: I get the following error:

In [17]: cursor.get_log()

AttributeError Traceback (most recent call last)

in () ----> 1 cursor.get_log() /home/ishaan/cmf/systest/target/env/src/impyla/impala/hiveserver2.pyc in get_log(self) 396 397 def get_log(self): --> 398 return self._last_operation.get_log() 399 400 def get_profile(self): AttributeError: 'NoneType' object has no attribute 'get_log' Both of these methods internally call _last_operation.get_{log, profile}() However, when a query fails, _last_operation is set to None (which is should not be).
julienbaley commented 8 years ago

@wesm can we get some help on this issue? This problem still exists in 0.13.7, except the _last_operation is not None anymore. When calling .get_log() on the cursor after a failed query, thriftpy sends thriftpy.thrift.TApplicationException: Invalid method name: 'GetLog'

This is a problem for us as we let user write their own SQL and we'd like to let them know what went wrong with their query..