[FLINK-35324][formats] Avro format can not perform projection pushdown for specific fields#28751
Open
johntomcat7408-cmyk wants to merge 1 commit into
Open
[FLINK-35324][formats] Avro format can not perform projection pushdown for specific fields#28751johntomcat7408-cmyk wants to merge 1 commit into
johntomcat7408-cmyk wants to merge 1 commit into
Conversation
Collaborator
…n for specific fields
johntomcat7408-cmyk
force-pushed
the
FLINK-35324-master
branch
from
July 16, 2026 01:57
fb709c3 to
7a04a22
Compare
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.
Supersedes #28746 (targeted
release-1.17), which targeted release-1.17. Moved to master per @davidradl's review; can be backported later.What is the purpose of the change
The avro format returns a ProjectableDecodingFormat, but projection pushdown only works when the projected fields start at index 0; a projection such as [[1], [2]] fails with ArrayIndexOutOfBoundsException. The deserializer used the projected schema as both the writer and reader schema, so the positional Avro decoding reads the wrong fields. This passes the full physical schema as the writer schema and the projected schema as the reader schema, so Avro schema resolution reads only the projected fields.
Brief change log
AvroDeserializationSchema: support an optional writer schema and resolve the input with setSchema(writer) + setExpected(reader); add a forGeneric(Schema reader, Schema writer) overload.
AvroFormatFactory#createRuntimeDecoder: use the projected schema as the reader schema and the full physical schema as the writer schema.
Verifying this change
AvroRowDataDeSerializationSchemaTest
Does this pull request potentially affect one of the following parts:
Dependencies (does it add or upgrade a dependency): no
The public API, i.e., is any changed class annotated with @public(Evolving): no
The serializers: no
The runtime per-record code paths (performance sensitive): yes
Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
The S3 file system connector: no
Documentation
Does this pull request introduce a new feature? no
If yes, how is the feature documented? not applicable