<@U04S8PLJWMT> - I set up a new connection to sync...
# replication-ask-ai
n
@kapa.ai - I set up a new connection to sync data from salesforce to snowflake. Airbyte created the destination table in the destination schema, the job finished successfully but there was no data in the snowflake destination table. Upon reviewing snowflake COPY_HISTORY, I noticed that the error : Number of columns in file (4) does not match that of the corresponding table (6), use file format option error_on_column_count_mismatch=false to ignore this error. WHy is this happening? How can I fix this so that the data gets loaded into the destination table?
k
There isn’t a knowledge-source document that describes this exact Snowflake error in the Salesforce→Snowflake scenario, so I can’t say with certainty why it’s happening in your setup. But we can infer a few things from how the Snowflake destination works and from similar issues. From the Snowflake COPY statement snippets in the issues, we know Airbyte uses
ERROR_ON_COLUMN_COUNT_MISMATCH = FALSE
in its file format when loading data into Snowflake via
COPY INTO
. [Snowflake bug; Snowflake copy] Your error message explicitly says
error_on_column_count_mismatch=true
, which means the COPY that failed is not using the expected Airbyte file format configuration. That strongly suggests: • The table schema in Snowflake has more columns (6) than the staged CSV files (4), and • The COPY operation that Snowflake is logging is using a file format (or override) where
ERROR_ON_COLUMN_COUNT_MISMATCH
is still
TRUE
, so Snowflake aborts the load instead of ignoring the mismatch. Because the job “finished successfully” in Airbyte but no data landed, this is similar in spirit to other cases where the destination assumes the load succeeded while Snowflake actually rejected rows due to schema or column mismatches. [Paginated stream issue] Given the limited information in the knowledge sources, here’s what you can concretely do to fix / debug it: 1. Check the Snowflake table vs. staged file columns ◦ Inspect the destination table Airbyte created in Snowflake (column list and order). ◦ In the Snowflake stage that Airbyte uses (e.g.
airbyte_stage__...
), download one of the
.csv.gz
files and confirm how many columns it has and in what order. ◦ If the table has 6 columns but the file only has 4, then two columns were added to the table (or created differently) that are not present in the staged data. 2. Verify that Airbyte’s Snowflake destination is not being overridden ◦ Ensure there is no custom FILE FORMAT or
COPY INTO
override in Snowflake (e.g. via a trigger, task, or custom stage definition) that forces
ERROR_ON_COLUMN_COUNT_MISMATCH = TRUE
. Airbyte’s own COPY format should have it set to
FALSE
. [Snowflake copy] ◦ If you have manually modified the stage or file format that Airbyte created, revert those changes or recreate the destination in Airbyte so it can recreate its own stage and file format. 3. Recreate the destination / connection if schema drift occurred ◦ If the table was altered manually (extra columns added, order changed), drop the table and let Airbyte recreate it on the next sync, or create a new Snowflake destination and a new connection so the schema and COPY configuration are clean and consistent. ◦ Make sure you’re not mixing “legacy raw tables” or other advanced options unless you specifically need them; there is at least one open bug in that area that causes column mismatches during connection checks. [Legacy raw bug] 4. Re-run the sync and re-check COPY_HISTORY ◦ After cleaning up, run the sync again and then check
COPY_HISTORY
for the Airbyte stage. You should see COPY commands with
ERROR_ON_COLUMN_COUNT_MISMATCH = FALSE
and no column-count errors. [Snowflake copy] Because the knowledge sources don’t include a step‑by‑step fix for this exact error, if the above checks don’t resolve it, the next best step is: • Export the full Airbyte job logs and • Open a GitHub issue or forum post with: ◦ The Snowflake table DDL ◦ The exact COPY command from
COPY_HISTORY
◦ A sample of the staged CSV file so the Airbyte team can confirm whether this is a connector bug similar to the existing Snowflake column-mismatch issues. [Legacy raw bug] 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.