title: Running HIve query through impala.dbapi fails when embedding "Add Jar"
body: <p>I'm launching a hive query through python <code>impala.dbapi</code>, which works nicely as following:</p>
  
  <pre><code>import os
  import pandas as pd
  from impala.dbapi import connect
  from impala.util import as_pandas
  from datetime import datetime
  
  user=os.environ['HIVE_USER']
  password=os.environ['HIVE_PASSWORD']
  up_to_date_query = '''  
  select * from dejavu.tracking_events limit 1
   ''' 
  conn = connect(host='ecprdbhdp02-clientgw.kenshooprd.local', port=10000,
                     user=user,
                     password=password,
                     auth_mechanism='PLAIN')
  cursor = conn.cursor()
  cursor.execute(up_to_date_query)
  df = as_pandas(cursor)
  df.head()
  </code></pre>
  
  <p>But when i'm adding the following "<code>Add Jar</code>" clause as following:</p>
  
  <pre><code>up_to_date_query = '''  
   ADD JAR hdfs://BICluster/user/yossis/udfs/hive-udf-0.1-SNAPSHOT.jar;
   select * from dejavu.tracking_events limit 1
   ''' 
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <pre><code>---------------------------------------------------------------------------
  HiveServer2Error                          Traceback (most recent call last)
  &lt;ipython-input-10-1e512abcc69e&gt; in &lt;module&gt;()
        4                    auth_mechanism='PLAIN')
        5 cursor = conn.cursor()
  ----&gt; 6 cursor.execute(up_to_date_query)
        7 df = as_pandas(cursor)
        8 df.head()
  
  /home/yehoshaphats/anaconda/lib/python2.7/site-packages/impala/hiveserver2.pyc in execute(self, operation, parameters, configuration)
      300         # PEP 249
      301         self.execute_async(operation, parameters=parameters,
  --&gt; 302                            configuration=configuration)
      303         log.debug('Waiting for query to finish')
      304         self._wait_to_finish()  # make execute synchronous
  
  /home/yehoshaphats/anaconda/lib/python2.7/site-packages/impala/hiveserver2.pyc in execute_async(self, operation, parameters, configuration)
      341             self._last_operation = op
      342 
  --&gt; 343         self._execute_async(op)
      344 
      345     def _debug_log_state(self):
  
  /home/yehoshaphats/anaconda/lib/python2.7/site-packages/impala/hiveserver2.pyc in _execute_async(self, operation_fn)
      360         self._reset_state()
      361         self._debug_log_state()
  --&gt; 362         operation_fn()
      363         self._last_operation_active = True
      364         self._debug_log_state()
  
  /home/yehoshaphats/anaconda/lib/python2.7/site-packages/impala/hiveserver2.pyc in op()
      338             op = self.session.execute(self._last_operation_string,
      339                                       configuration,
  --&gt; 340                                       async=True)
      341             self._last_operation = op
      342 
  
  /home/yehoshaphats/anaconda/lib/python2.7/site-packages/impala/hiveserver2.pyc in execute(self, statement, configuration, async)
     1025                                    confOverlay=configuration,
     1026                                    runAsync=async)
  -&gt; 1027         return self._operation('ExecuteStatement', req)
     1028 
     1029     def get_databases(self, schema='.*'):
  
  /home/yehoshaphats/anaconda/lib/python2.7/site-packages/impala/hiveserver2.pyc in _operation(self, kind, request)
      955 
      956     def _operation(self, kind, request):
  --&gt; 957         resp = self._rpc(kind, request)
      958         return self._get_operation(resp.operationHandle)
      959 
  
  /home/yehoshaphats/anaconda/lib/python2.7/site-packages/impala/hiveserver2.pyc in _rpc(self, func_name, request)
      923         response = self._execute(func_name, request)
      924         self._log_response(func_name, response)
  --&gt; 925         err_if_rpc_not_ok(response)
      926         return response
      927 
  
  /home/yehoshaphats/anaconda/lib/python2.7/site-packages/impala/hiveserver2.pyc in err_if_rpc_not_ok(resp)
      702             resp.status.statusCode != TStatusCode.SUCCESS_WITH_INFO_STATUS and
      703             resp.status.statusCode != TStatusCode.STILL_EXECUTING_STATUS):
  --&gt; 704         raise HiveServer2Error(resp.status.errorMessage)
      705 
      706 
  
  HiveServer2Error: Error while processing statement: null
  </code></pre>
  
  <p>Notice that the query works properly when running it directly in Hive (through the <code>hue</code> console).</p>
  
  <p>After searching for similar questions, it seems like no one asked for exactly the same problem :(</p>
  
  <p>Thanks in advance!</p>