Keep files readable when they use future logical types#3669
Open
kevinjqliu wants to merge 1 commit into
Open
Conversation
kevinjqliu
commented
Jul 16, 2026
| import org.junit.Test; | ||
|
|
||
| public class TestInterOpReadUnknownLogicalType { | ||
| private static final String REFERENCE_FILE = "unknown-logical-type.parquet"; |
Author
There was a problem hiding this comment.
Added a test using the parquet-testing artifact
unknown-logical-type.parquet
A file containing a column annotated with a LogicalType whose identifier has been set to an abitrary high value to check the behaviour of an old reader reading a file written by a new writer containing an unsupported type (see related issue).
-- from https://github.com/apache/parquet-testing/blob/master/data/README.md
ref: https://github.com/apache/parquet-testing/blob/master/data/unknown-logical-type.parquet
kevinjqliu
force-pushed
the
kevinjqliu/unknown-logical-type-forward-compatible
branch
from
July 16, 2026 19:14
4aa0e2e to
f9fba56
Compare
kevinjqliu
force-pushed
the
kevinjqliu/unknown-logical-type-forward-compatible
branch
from
July 16, 2026 19:44
f9fba56 to
33d2f58
Compare
kevinjqliu
marked this pull request as ready for review
July 17, 2026 03:33
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.
This is part of the effort to ensure that new logical types are forward compatible (See apache/parquet-format#599)
Description
This makes parquet-java more tolerant of Parquet files written by newer implementations.
A newer writer may use a logical type that this version of parquet-java does not know about yet. The file can still have a perfectly valid physical column type, but today the reader fails while trying to interpret the unknown logical-type metadata.
The fix is to handle that case in
ParquetMetadataConverter, where file metadata is translated into parquet-java schema annotations. If the logical type cannot be understood, the converter now leaves the column as its physical type instead of failing. That is the right behavior for forward compatibility: readers should preserve the data they can understand, and only apply logical annotations when they are known.This also keeps the existing fallback behavior intact for files that include older
converted_typemetadata.Tests
Added tests cover reading an unknown logical type both with and without a
converted_typefallback.