[core] Validate the changelog format's type limits at DDL time - #10262
Open
LuciferYang wants to merge 1 commit into
Open
LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
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
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.
Purpose
SchemaValidationvalidated only the base data-file format's data fields at DDL. Changelog files are written with thechangelog-file.formatwhen it is set (KeyValueFileWriterFactoryselects 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 examplefile.format=parquetwithchangelog-file.format=avroand 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
validateDataFieldsover the same normal fields wheneverchangelog-file.formatis 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 withchangelog-file.format=avrois 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.