Skip to content

[core] Validate the changelog format's type limits at DDL time - #10262

Open
LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:m/core-084-changelog-format
Open

LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:m/core-084-changelog-format

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

Purpose

SchemaValidation validated only the base data-file format's data fields at DDL. Changelog files are written with the changelog-file.format when it is set (KeyValueFileWriterFactory selects it for changelog keys), so a column type unsupported by the changelog format was accepted at CREATE and failed only on the first changelog write. For example file.format=parquet with changelog-file.format=avro and a TIMESTAMP(9) or TIME(4+) column passes CREATE and then throws from the Avro schema conversion when the first changelog file is written.

This runs the changelog format's validateDataFields over the same normal fields whenever changelog-file.format is set and differs from the base data format, so the incompatibility is reported at DDL time. This mirrors the existing base-format and per-level avro validation in the same method.

This closes #10261.

Tests

Added SchemaValidationTest.testChangelogFileFormatRejectsUnsupportedTypes: a TIMESTAMP(9) column with changelog-file.format=avro is rejected at validation with the Avro precision message, and a parquet base with an orc changelog format keeps the same column accepted (both formats support the type, exercising the differing-format path).

API and Format

No.

Documentation

No.

SchemaValidation ran validateDataFields only for the base data-file
format, although changelog files are written with the changelog-file
format whose type limits can differ. A table with a TIMESTAMP(7-9)
or TIME(4+) column and changelog-file.format=avro passed the DDL and
crashed on the first changelog file write.

Run the changelog format's validateDataFields over the same normal
fields whenever it is set and differs from the data format.

Assisted-by: GLM-5.3
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.

[Bug] Changelog file format's type limits are not validated at DDL time

1 participant