found more columns than expected column count 35

Lilly W 130 Reputation points
2023-02-08T03:07:44.7533333+00:00
  1. I'm using an ADF pipeline to export a gz csv file from an SFTP to Azure Storage Explorer. After unzipping the file I'm having problems importing it. When I try to import it (DelimitedText2) into an Azure SQL Server DB I'm getting this error. I checked and the file is ok. found more columns than expected column count 35 . screenshot1 screenshot2 screenshot3
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} vote

Accepted answer
  1. KranthiPakala-MSFT 46,642 Reputation points Microsoft Employee Moderator
    2023-02-14T01:21:01.7666667+00:00

    Hi Lilly W,

    Thanks for the question and using Microsoft Q&A forum.

    As per your description, it seems like purely a source data format issue. In case if you source data, column values are enclosed in quote characters (as shown in below example), and you have extra comma (nothing but the column delimiter in your case) then as Nandan Hegde called out, you can use Quote character setting in your data set to escape them and avoid issue while reading the data.

    User's image

    If you are source column contain the column delimiter in your column values and the column values are enclosed in quote character, then you will have to configure dataset as below to overcome the issue.
    User's image

    In case if your source data does not contain any quote characters for your column values, then it will be hard to fix it at the pipeline runtime.

    User's image

    Possible workaround:

    • Option 1: The source provide has to correct the data before submitting to ADF pipeline.
    • Option 2 (recommended if you don't have control over the source file generation) : Copy activity supports detecting, skipping, and logging incompatible tabular data using Fault tolerance feature. The way this featrure works is that the CSV file rows that contain expected number of columns are copied successfully to the sink store. The CSV file rows that contain more than expected columns are detected as incompatible and are skipped and logged as per the configuration. You can then log the skipped incompatible rows into storage account and then fix them manually or some other process and reprocess them through the pipeline. User's image Here is reference doc for Fault tolerance in copy activity: Copy activity Fault tolerance

    Hope this info helps.


    Please don’t forget to Accept Answer and Up-Vote wherever the information provided helps you, this can be beneficial to other community members.

    3 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.