Forum Discussion

Alex_Mattics's avatar
Alex_Mattics
New Member
1 year ago
Solved

Issues in CSV Import

So, Received data from an outside source regarding pertinent information for pulling into a data lakehouse on Fabric. The Initial import of the data functioned from the CSV file once it was cleaned...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Alex_Mattics,

    Thanks for reaching out to the Microsoft fabric community forum.

    It seems while importing data from an external source into the Lakehouse, the initial import succeeded, and data was successfully written to a Delta table in the Fabric Lakehouse. You applied the same process to a second CSV file meant to append to the existing table but encountered this error "[DELTA_FAILED_TO_MERGE_FIELDS] Failed to merge fields 'PERMIT_NUMBER' and 'PERMIT_NUMBER' Error Code: InvalidTable".

    This usually happens because even though the column names look identical (PERMIT_NUMBER and PERMIT_NUMBER), Delta Lake is detecting a conflict between these two fields which usually happens because of hidden metadata mismatches. The reasons can vary from different Data types or one column might allow nulls and the other might not. This difference can also trigger a merge failure.

    As nilendraFabric has already responded to your query, kindly go through his response and check if it solves your query and then mark the helpful reply as solution so that other community members can find it easily.

     

    I would also take a moment to thank nilendraFabric, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

     

    If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

    Best Regards,
    Hammad.
    Community Support Team

     

    If this post helps then please mark it as a solution, so that other members find it more quickly.

    Thank you.

  • burakkaragoz's avatar
    1 year ago

    Hi Alex_Mattics ,

     

    From what you described, it sounds like the import process is not recognizing existing records correctly — which usually points to either:

    1. Missing or incorrect primary key mapping during import. If the system can’t match incoming rows to existing ones based on a unique key, it won’t update — it’ll either skip or try to insert duplicates (and fail silently if constraints are in place).

    2. Import mode behavior — some systems treat “import” as insert-only unless explicitly told to do an upsert. If you’re using a tool or script, check if there’s an “update if exists” or “merge” option.

    3. Triggers or constraints — as others mentioned, these can block updates silently or redirect logic. Try disabling them temporarily to isolate the issue.

    If you’re using SQL Server, I’d recommend switching to a MERGE statement or using INSERT ... ON DUPLICATE KEY UPDATE logic if supported by your import tool.

    Also, make sure your CSV headers exactly match the column names and that there’s no hidden whitespace or encoding issues — those can silently break mapping.

    If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.