Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Riym
New Member

Loading delta tables into a lakehouse

Hi All,

 

Please HELP, I am new to fabric and struggling to load my files to delta tables in a lakehouse.

once uploading my data file (in CSV.) format and then Load to tables it gives an error regarding my CSV headers see below.

I don't know what else to do as it allows me to load delta tables without the headers. Please help

Server Error.
Message: Invalid column name(s) 'OnBDQ;Onshortregimen;RegimenType;RegistrationYear;Type;DRTBUnit;DRTBProvince;DRTBSubDistrict;DRTBDistrict;PreviousDrug;Gender;TreatmentOutcome' in file 'Files/Sedibengdata2.csv'. Column names must contain UTF-8 encoded Unicode word characters and can be a maximum of 128 characters long. Unicode word characters include letters of any case and their nonspacing marks, punctuation connectors like the underscore(_), and decimal digits, but no space characters are allowed.
Activity Id (Failed Request) : 23167694-e0ee-47d6-b79f-d85d20abbce1
Error Code : InvalidColumnName
HTTP response code : 400
User session Id : 696e2c1f-1ad3-4590-b9c8-485da94199d0

2 ACCEPTED SOLUTIONS

Thanks for the help, how do I ensure that my headers are UTF-8 encoded Unicode word characters? I am so lost, thank you for the explanation above.

View solution in original post

BartStens
New Member

Dear @Riym ,

 

I was also struggling with exact same error msg. My headers followed requirements exactly as UTF-8 demands, but still got the error msg.

 

Turns out I had to specify my column-seperator a.k.a. delimiter in the prompt when selecting the three dots near the file > "Load file in new table" then enter de correct delimiter used in your .csv-file, in my case a comma (,) was pre-filled in the prompt, but my .csv-file used (;) so had to adjust that one and load was succesfull!

 

See below screencap (sorry it's in Dutch-UI)

Schermafbeelding 2024-05-22 152023.png

View solution in original post

5 REPLIES 5
BartStens
New Member

Dear @Riym ,

 

I was also struggling with exact same error msg. My headers followed requirements exactly as UTF-8 demands, but still got the error msg.

 

Turns out I had to specify my column-seperator a.k.a. delimiter in the prompt when selecting the three dots near the file > "Load file in new table" then enter de correct delimiter used in your .csv-file, in my case a comma (,) was pre-filled in the prompt, but my .csv-file used (;) so had to adjust that one and load was succesfull!

 

See below screencap (sorry it's in Dutch-UI)

Schermafbeelding 2024-05-22 152023.png

v-cboorla-msft
Microsoft Employee
Microsoft Employee

Hi @Riym 

 

Thanks for using Microsoft Fabric Community.

 

The error message you received indicates that there are invalid column names in your CSV file. Specifically, the column names listed include characters that do not meet the requirements for Delta tables.

Delta tables expect column names to be UTF-8 encoded Unicode word characters, which means they can include letters (of any case), nonspacing marks, punctuation connectors (like underscores), and decimal digits. However, spaces are not allowed. To resolve this, ensure that your CSV file’s column headers adhere to these rules.

Table names must contain alphanumeric characters and underscores. Column names allow any English letters (upper or lower case), underscores, and characters from other languages (such as Chinese) in UTF, up to 32 characters. If a proper column name cannot be achieved during validation, the load action will fail.

 

I hope this information helps. Please do let us know if you have any further queries.

 

Thank you.

Thanks for the help, how do I ensure that my headers are UTF-8 encoded Unicode word characters? I am so lost, thank you for the explanation above.

I'm pretty sure your issue is that your column names contain spaces, i.e. Customer Name. You'll need to go through the list of columns and replace the spaces, either CustomerName or Customer_Name are both valid.

Hi, I had the same problem and its just when you try to load the dataset to Delta Table from UI, its forcing us to use a proper format for column headers with no spaces or special character. 

 

You can solve this problem by using a notebook

Load the csv into a pandas df and write it with delta.columnMapping.mode", "name" which lets the df to write into a Table with spaces in column headers.

 

``` 

import pandas as pd
# Load data into pandas DataFrame from "/lakehouse/default/Files/metadata.csv"
df = pd.read_csv("/lakehouse/default/Files/metadata.csv")
display(df)
spark_df = spark.createDataFrame(df)
spark_df.write.format("delta").option("delta.columnMapping.mode", "name").saveAsTable("dbo.Sample")
```
 
Hope this helps.
Thanks

Helpful resources

Announcements
Fabric July 2025 Monthly Update Carousel

Fabric Monthly Update - July 2025

Check out the July 2025 Fabric update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.