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: 16 Oct 2020

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

1. 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>

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.

Additional Information

Default StringColumnLength - Default Value is 255
https://www.simba.com/products/Spark/doc/v2/ODBC_InstallGuide/mac/content/odbc/options/defaultstringcolumnlength.htm

Simba Spark ODBC Driver with SQL Connector (scroll to "Default String Column Length" section)
https://docs.datafabric.hpe.com/60/attachments/JDBC_ODBC_drivers/SparkODBCInstallandConfigurationGuide.pdf

Connecting to Databricks
https://docs.databricks.com/integrations/bi/tableau.html
Did this article resolve the issue?