Bug report: the delimiter option does not work when run on DLT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 04:09 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 10:41 PM - edited 11-28-2023 10:44 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 03:45 AM
@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.

