title: Displaying the progress of a Hive query
body: <p>I am connecting to Hive through <code>pyodbc</code>. The connection is successful and I can execute my queries. </p>
  
  <p>I have build a progress function to show me the progress of the job I submit, which is essentially a progress bar. However, I cannot see the progress bar</p>
  
  <p>The standalone function is working, but it is not working when I put it in front of another function.</p>
  
  <pre class="lang-py prettyprint-override"><code>from time import sleep
  import sys
  def progress_sec(x):
      for i in range(21):
          sys.stdout.write('\r')
          sys.stdout.write("[%-20s] %d%%" % ('='*i, 5*i))
          sys.stdout.flush()
          sleep(0.25)
      return
  </code></pre>
  
  <p>The function above is my progress bar function, and I'm trying to put this in front of:</p>
  
  <pre class="lang-py prettyprint-override"><code>df_hotels = progress_sec(pd.read_sql(sql, con))
  </code></pre>
  
  <p>where both <code>sql</code> and <code>con</code> have been defined and working.</p>
  
  <p>I want a progress bar showing me the progress of when <code>df_hotels</code> line starts execution, but I couldn't get this to work.</p>