<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Incorrect length for `string` returned by the Databricks ODBC driver in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/incorrect-length-for-string-returned-by-the-databricks-odbc/m-p/114766#M44937</link>
    <description>&lt;P&gt;Is there a permanent solution for this? We are still seeing this issue and it's been years.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Apr 2025 02:09:34 GMT</pubDate>
    <dc:creator>JR-20773</dc:creator>
    <dc:date>2025-04-08T02:09:34Z</dc:date>
    <item>
      <title>Incorrect length for `string` returned by the Databricks ODBC driver</title>
      <link>https://community.databricks.com/t5/data-engineering/incorrect-length-for-string-returned-by-the-databricks-odbc/m-p/12538#M7338</link>
      <description>&lt;P&gt;Dear Databricks and community,&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;I have been struggling with a bug related to using &lt;A href="https://golang.org/" alt="https://golang.org/" target="_blank"&gt;golang&lt;/A&gt; and the &lt;A href="https://databricks.com/spark/odbc-drivers-download" alt="https://databricks.com/spark/odbc-drivers-download" target="_blank"&gt;Databricks ODBC driver&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;It turns out that `SQLDescribeColW` consequently returns 256 as a length for `string` columns. However, in Spark, strings might be much longer than that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is normally not an issue unless the ODBC library actively uses this information when allocating and reading data. This is the case for &lt;A href="https://github.com/alexbrainman/odbc/" alt="https://github.com/alexbrainman/odbc/" target="_blank"&gt;alexbrainman/odbc&lt;/A&gt;, which allocates 256 bytes for the strings and seg-faults when it reads cells where the strings are longer than 256 bytes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue, and the fix, is described in detail here: &lt;A href="https://github.com/alexbrainman/odbc/issues/165" alt="https://github.com/alexbrainman/odbc/issues/165" target="_blank"&gt;https://github.com/alexbrainman/odbc/issues/165&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I know, the driver is developed by Magnitude (&lt;A href="https://www.magnitude.com/drivers/spark-jdbc-odbc" alt="https://www.magnitude.com/drivers/spark-jdbc-odbc" target="_blank"&gt;https://www.magnitude.com/drivers/spark-jdbc-odbc&lt;/A&gt;) , so I will see if there is a way for me to let them know about this bug. Still, since the driver is distributed by Databricks, I felt a post/bug report would be beneficial in this repository as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Håkon&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 09:11:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/incorrect-length-for-string-returned-by-the-databricks-odbc/m-p/12538#M7338</guid>
      <dc:creator>Håkon_Åmdal</dc:creator>
      <dc:date>2021-10-25T09:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect length for `string` returned by the Databricks ODBC driver</title>
      <link>https://community.databricks.com/t5/data-engineering/incorrect-length-for-string-returned-by-the-databricks-odbc/m-p/12539#M7339</link>
      <description>&lt;P&gt;Thanks for posting this issue @Håkon Åmdal​&amp;nbsp;. We should be able to reproduce and report it to the Magnitude team subsquently.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 10:19:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/incorrect-length-for-string-returned-by-the-databricks-odbc/m-p/12539#M7339</guid>
      <dc:creator>User16829050420</dc:creator>
      <dc:date>2021-10-25T10:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect length for `string` returned by the Databricks ODBC driver</title>
      <link>https://community.databricks.com/t5/data-engineering/incorrect-length-for-string-returned-by-the-databricks-odbc/m-p/114766#M44937</link>
      <description>&lt;P&gt;Is there a permanent solution for this? We are still seeing this issue and it's been years.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 02:09:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/incorrect-length-for-string-returned-by-the-databricks-odbc/m-p/114766#M44937</guid>
      <dc:creator>JR-20773</dc:creator>
      <dc:date>2025-04-08T02:09:34Z</dc:date>
    </item>
  </channel>
</rss>

