Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ishaan opened this issue Dec 8, 2015 · 1 comment
Open

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

ishaan opened this issue Dec 8, 2015 · 1 comment

Comments

@ishaan
Copy link
Contributor

ishaan commented Dec 8, 2015

Use Case:

Run a query through impyla, and the query fails. I want to get some additional information, namely:
- The error log (via cursor.get_log())
- The query profile (via cursor.get_profile())

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
Copy link
Contributor

@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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants