KNOWLEDGE BASE

String Fields In Database Have More Than 255 Characters Are Truncated When Connecting To Databricks In Tableau Desktop


Published: 16 Oct 2020
Last Modified Date: 30 Aug 2023

Issue

When connecting to Databricks in Tableau Desktop, if the string fields has more than 255 characters, they will be truncated to 255 characters. 

Environment

  • Tableau Desktop 
  • Databricks Connector 
  • SparkSQL ODBC driver  

Resolution

Option 1 (recommended)

Use TDC file to increase the String Column Length:

<?xml version='1.0' encoding='utf-8' ?>
<connection-customization class='databricks' enabled='true' version='10.4'>
  <vendor name='databricks'/>
  <driver name='databricks'/>
  <customizations>
    <customization name='odbc-connect-string-extras' value='DefaultStringColumnLength=500' />
  </customizations>
</connection-customization>

Option 2

Change the default value from DSN and then use ODBC connector: 
User-added image

Cause

The truncation of the 'string' field to 255 characters is caused by a default String Column Length within SparkSQL ODBC driver.
Did this article resolve the issue?