feat(copy): improve ColumnMissingError with contextual advice#20029
feat(copy): improve ColumnMissingError with contextual advice#20029youngsofun wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 144d6fc090
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
144d6fc to
14978ca
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 23e956fb0f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Enhance error messages for missing columns during COPY INTO to help users diagnose and resolve issues faster: - Show the current MISSING_FIELD_AS setting - Indicate when a column is not nullable (for MISSING_FIELD_AS=NULL) - Suggest COLUMN_MATCH_MODE=CASE_INSENSITIVE when a case-different match exists in the source data - Suggest SELECT $1 pattern when target table has a single VARIANT column Applied consistently across NDJSON, Parquet, and ORC formats. The new advice field uses #[serde(default)] for rolling upgrade compatibility.
105859f to
f65b090
Compare
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
fix: #18834
Enhance error messages for missing columns during COPY INTO to help users diagnose and resolve issues faster.
When a column is missing, the error now includes contextual advice:
MISSING_FIELD_ASsettingMISSING_FIELD_AS=NULLcase)COLUMN_MATCH_MODE=CASE_INSENSITIVEwhen a case-different match exists in the source dataCOPY INTO <table> FROM (SELECT $1 FROM @<stage>)when the target table has a single VARIANT columnApplied consistently across NDJSON, Parquet, and ORC formats.
Example before:
Example after:
Tests
Type of change
This change is