Skip to content

fix(spec): reject changelog-producer on tables without primary keys - #670

Open
jackylee-ch wants to merge 1 commit into
apache:mainfrom
jackylee-ch:fix/changelog-producer-requires-pk
Open

fix(spec): reject changelog-producer on tables without primary keys#670
jackylee-ch wants to merge 1 commit into
apache:mainfrom
jackylee-ch:fix/changelog-producer-requires-pk

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

A non-none changelog-producer on a table without primary keys was accepted at
both create and alter time. An append table has no merge step, so no changelog can
ever be produced: the option is persisted into the schema and then silently ignored
by the write path, which derives input_changelog from the producer alone and never
reaches a compaction that could emit changelog files. Users get a table that claims
to produce a changelog and quietly does not. Java rejects this in
SchemaValidation#validateTableSchema with "Can not set changelog-producer on table
without primary keys, please define primary keys."

Fix: add validate_changelog_producer_requires_primary_keys to
Schema::validate_final_schema, so it runs on both paths, as #660 arranged. Only a
non-NONE producer is rejected — an append table may still spell the default out
explicitly, matching Java's != ChangelogProducer.NONE guard.

No behavior change for any table that has primary keys, or for changelog-producer=none.

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