Skip to content

Conversation

@patrickwwbutler
Copy link
Contributor

Currently, if a NOT NULL column in the destination table does not have a default, and is not specified to be copied into by the COPY FROM statement, materialize will panic at the time of Row encoding, which is very undesirable behavior. By checking at query planning time, we can reject the COPY FROM statement early on with a descriptive error message.

Motivation

  • This PR fixes a recognized bug.

https://github.com/MaterializeInc/database-issues/issues/9886

Tips for reviewer

I did use Claude to write this, but I double checked everything and it seems reasonable and correct. My only concern is if this is the right location to be performing this check.

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

@patrickwwbutler patrickwwbutler requested review from a team and mtabebe January 29, 2026 17:15
@patrickwwbutler
Copy link
Contributor Author

this PR is "stacked" on top of #34849, so it technically includes the changes from there, as well.

@patrickwwbutler patrickwwbutler changed the title [oneshot] Add validation for NOT NULL columns to COPY FROM query planning [oneshot] SS-49 Add validation for NOT NULL columns to COPY FROM query planning Jan 29, 2026
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.

1 participant