Skip to content

fix(output-mapping): clarify column swap validation errors - #562

Merged
odinuv merged 2 commits into
mainfrom
devin/1787123642-output-mapping-column-swap-error
Aug 27, 2026
Merged

fix(output-mapping): clarify column swap validation errors#562
odinuv merged 2 commits into
mainfrom
devin/1787123642-output-mapping-column-swap-error

Conversation

@OlenaMarchuk

@OlenaMarchuk OlenaMarchuk commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

AbstractTableStructureValidator::validateColumnsName() reported only one half of the mismatch, which made real failures misleading. Production job 1325273716 failed with:

Table "in.c-keboola-ex-db-mysql.magazine_posts" does not contain columns: "title_square_image".

The actual cause was a column swap in the source (one column replaced by another): a column disappeared from the schema, so the counts matched and the new column could not be auto-added. Read literally, the old message points at the added column and hides the blocker.

Both throws now also list array_diff($tableColumns, $schemaColumnsNames) — the columns that exist in the table but not in the schema — and the swap case explains that renames/replacements are not applied automatically:

Table "…" does not contain columns: "title_square_image". Columns "title_image" are present in the
table but missing in the schema. This usually means a column was renamed or replaced; such a change
cannot be applied automatically. Drop the obsolete columns from the table — the new ones will be
added on the next run.

Note the control flow this relies on: the does not contain columns throw is reachable only when column counts are equal and the diff is non-empty (always a swap), and the same number of columns throw only when the table has columns absent from the schema — so the appended list is never empty. No behaviour change; the missing-columns auto-add path is untouched.

Link to Devin session: https://app.devin.ai/sessions/cd95e73b195c46c4abeea2af594577e8
Requested by: @OlenaMarchuk

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot marked this pull request as draft August 19, 2026 07:19
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review August 19, 2026 08:01
@devin-ai-integration
devin-ai-integration Bot requested a review from odinuv August 19, 2026 08:01
@odinuv
odinuv force-pushed the devin/1787123642-output-mapping-column-swap-error branch from e8fb541 to e241cad Compare August 27, 2026 19:38
@odinuv
odinuv merged commit b099532 into main Aug 27, 2026
33 checks passed
@odinuv
odinuv deleted the devin/1787123642-output-mapping-column-swap-error branch August 27, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants