[FLINK-38205][format][pb] Discard unknown fields by default
What is the purpose of the change
Currently, Flink Protobuf format does not discard unknown fields (and it does not even provide an option for that!). When the user PB IDL is a subset of the whole IDL, quite a few CPU is wasted for no means as Flink SQL will automatically discard all unknown fields anyway when converting to RowData. We should make it discard unknown fields by default.
Brief change log
Use PB's DiscardUnknownFieldsWrapper to wrap the parser.
Verifying this change
This change is already covered by existing PB format tests.
Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (yes / no)
- The public API, i.e., is any changed class annotated with
@Public(Evolving): (yes / no) - The serializers: (yes / no / don't know)
- The runtime per-record code paths (performance sensitive): (yes / no / don't know)
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
- The S3 file system connector: (yes / no / don't know)
Documentation
- Does this pull request introduce a new feature? (yes / no)
- If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
CI report:
- 93bfd84b4e3b8e795e8c3774506ceeb0ed722585 Azure: SUCCESS
Bot commands
The @flinkbot bot supports the following commands:@flinkbot run azurere-run the last Azure build
@davidradl Those existing tests for protobuf with unknown fields are still valid, and actually act as good testcases for this PR already.
I'll add a separate testcase for unknown fields.