Conversation
The INSERT used `SELECT *` from jsonb_populate_recordset, which named every column and fed NULL into columns absent from the Feldera schema, breaking DEFAULT values of columns. List only the supplied columns so Postgres applies each omitted column's DEFAULT. Signed-off-by: Swanand Mulay <73115739+swanandx@users.noreply.github.com>
mihaibudiu
approved these changes
Jul 22, 2026
mythical-fred
approved these changes
Jul 22, 2026
mythical-fred
left a comment
There was a problem hiding this comment.
APPROVE. Neat fix for #6694: explicit column list in the jsonb_populate_recordset INSERT so Postgres applies column DEFAULTs (and NOT NULL DEFAULT columns like served_at TIMESTAMP DEFAULT now() NOT NULL) instead of SELECT * forcing NULL into every omitted column.
- CDC path also lists the
__feldera_op/__feldera_tsmetadata columns explicitly — consistent with the materialized path and with the existing pipeline invariant thatvalue_schema.fieldsdoesn't already contain those. - Case-sensitive columns stay quoted (test
materialized_insert_quotes_case_sensitive_columnslocks that in). - Integration test creates a real
NOT NULL DEFAULT now()column outside the Feldera schema and asserts every row'sserved_atwas populated from the DEFAULT — the exact failure mode from #6694.
One optional follow-up (non-blocking): the CDC branch pushes cdc_op_column/cdc_ts_column into insert_columns while the materialized branch does not — if a future refactor merges those config fields into value_schema, the CDC branch will silently double-list them. A one-line debug_assert that insert_columns has no duplicates would catch that regression cheaply, but it's not worth blocking on now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The INSERT used
SELECT *from jsonb_populate_recordset, which named every column and fed NULL into columns absent from the Feldera schema, breaking DEFAULT values of columns. List only the supplied columns so Postgres applies each omitted column's DEFAULT.Fixes #6694
Describe Manual Test Plan
relying on added tests
Checklist
Breaking Changes?
should not be.