It seems the Impyla (HS2 client for Python stress test) DB API paradigm doesn't lend itself to the ideal collection of query profiles.
- It seems a profile will not have an ExecSummary, End Time, or Errors unless the profile is requested after a CloseOperation RPC. This makes sense to me.
- GetRuntimeProfile RPC must be called before the CloseSession RPC. This makes sense to me.
- One can't really use standard, public methods in Impyla to do this: impala.hiveserver2.HiveServer2Cursor().close() handles both the CloseOperation and CloseSession RPCs in a single call.
- The same is true of the cursor in a context manager _exit_ setting. _exit_ just calls close()
This means we have to tap into the more private bits of Impyla to do this.
We should think about pythonic ways to make this better for Impyla, or at least alter the stress test to get the profiles of the queries after CloseOperation.