cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

Bug report: the delimiter option does not work when run on DLT

rpl
New Contributor III

I have a semicolon separated file in an ADLS container that's been added to Unity Catalog as an External location.

When I run the following code on an all-purpose cluster, it runs ok and displays the schema.

import dlt
@dlt.table
def test_data_csv():
  return (
     spark.readStream.format("cloudFiles")
     .option("cloudFiles.format", "csv")
     .option("delimiter", ";")
     .load(f"abfss://<container_name>@<storage_name>.dfs.core.windows.net/test_csv")
 )

The same code throws an error when ran via a Delta Live Tables pipeline:

com.databricks.sql.transaction.tahoe.DeltaAnalysisException: Found invalid character(s) among ' ,;{}()\n\t=' in the column names of your schema.

2 REPLIES 2

rpl
New Contributor III

As mentioned, the code runs just fine on an all-purpose cluster, therefore special characters can't be the problem.

But i checked this further by making two versions of the file:

  • a regular CSV with comma as separator and dot as decimal separator,
  • the identical file but “European-style” with semicolon as separator and comma as decimal separator.

The regular CSV file works fine in a DLT pipeline, therefore there are no invalid characters in the column names

If I don’t use .option("delimiter", ";"), then attempting to read the European-style CSV file throws the mentioned error both when run on an all-purpose cluster and when run in a DLT pipeline (as expected, because semicolons are invalid in column names).

When I specify .option("delimiter", ";"), the code will run on an all-purpose cluster but will throw the mentioned error when run in a DLT pipeline. To me that seems to indicate that .option("delimiter", ";") is for some reason ignored when run via DLT pipelines. The special characters indicated by the error message must be the semicolons, as there are no other special characters in the first row.

Can anyone reproduce this? 

rpl
New Contributor III

@Retired_mod can you confirm that .option("delimiter", ";") is ignored when run in a DLT pipeline? (please see the post above) My colleage confirmed the behavior. 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group