title: pyodbc in Databricks: A retriable error occurred while attempting to download a result file from the cloud store but the retry limit had been exceeded
body: <p>I have an SQL endpoint in Azure Databricks that I need to query. I have installed the Simba Spark ODCB connector and configured it correctly because when I call the end point with the Python Databricks library it returns the full dataframe (about 900K rows).</p>
  <pre><code>from databricks import sql
  import pandas as pd
  
  def databricks_to_dataframe():
      with sql.connect(server_hostname=&quot;&lt;server host name&gt;&quot;,
                      http_path=&quot;&lt;http path&gt;&quot;,
                      access_token=&quot;&lt;access token to databricks&gt;&quot;) as connection:
          with connection.cursor() as cursor:
              cursor.execute(&quot;SELECT * FROM my_table&quot;)
              result = cursor.fetchall()
              df = pd.DataFrame(result)
      return df
  </code></pre>
  <p>When I try to do the same with pyodc, I get the following error:</p>
  <p>Error: ('HY000', &quot;[HY000] [Simba][Hardy] (35) Error from server: error code: '0' error message: '[Simba][Hardy] (134) File 31dc6dfe-3a38-4e4a-8f03-66f6efdb4581: A retriable error occurred while attempting to download a result file from the cloud store but the retry limit had been exceeded. Error Detail: File 31dc6dfe-3a38-4e4a-8f03-66f6efdb4581: The result file URL had expired on 1658755584065 (Unix timestamp)'. (35) (SQLFetch)&quot;)</p>
  <p>Here the code for reference:</p>
  <pre><code>import pyodbc
  conn = pyodbc.connect(&quot;DSN=My_DSN&quot;, autocommit=True)
  cursor = conn.cursor()
  cursor.execute(&quot;SELECT * FROM my_table&quot;)
  data = cursor.fetchall()
  </code></pre>
  <p>When I limit the query to, say to 20k rows it works fine.</p>
  <p>And I have the same issue with R (RODBC) but this time no error message at all, just an empty dataframe! Below is the code in R:</p>
  <pre><code>library(RODBC)
  conn &lt;- odbcConnect(&quot;My_DSN&quot;)
  Data &lt;- sqlQuery(conn, &quot;SELECT * FROM my_table&quot;)
  </code></pre>
  <p>Here too, when I limit the query to a few k, it works fine. any ideas?
  Thanks!</p>