Skip to content

Commit 54de03d

Browse files
committed
remove release note section; mark patched code in PatchedProtoWriteSupport
1 parent e64a205 commit 54de03d

File tree

2 files changed

+8
-24
lines changed

2 files changed

+8
-24
lines changed

docs/content/release-notes/flink-2.1.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -183,26 +183,3 @@ Bump flink-shaded version to 20.0 to support Smile format.
183183

184184
Bump parquet version to 1.15.3 to resolve parquet-avro module
185185
vulnerability found in [CVE-2025-30065](https://nvd.nist.gov/vuln/detail/CVE-2025-30065).
186-
187-
#### Upgrade Protocol Buffers to 4.32.1
188-
189-
##### [FLINK-38547](https://issues.apache.org/jira/browse/FLINK-38547)
190-
191-
Flink now uses protobuf-java 4.32.1 (corresponding to Protocol Buffers version 32), upgrading from
192-
protobuf-java 3.21.7 (Protocol Buffers version 21). This major upgrade enables:
193-
194-
- **Protobuf Editions Support**: Full support for the new `edition = "2023"` and `edition = "2024"`
195-
syntax introduced in Protocol Buffers v27+. Editions provide a unified approach that combines
196-
proto2 and proto3 functionality with fine-grained feature control.
197-
- **Improved Proto3 Field Presence**: Better handling of optional fields in proto3 without the
198-
limitations of older protobuf versions, eliminating the need to set `protobuf.read-default-values`
199-
to `true` for field presence checking.
200-
- **Enhanced Performance**: Leverages performance improvements and bug fixes from 11 Protocol
201-
Buffers releases (versions 22-32).
202-
- **Modern Protobuf Features**: Access to newer protobuf capabilities including Edition 2024
203-
features and improved runtime behavior.
204-
205-
Users with existing proto2 and proto3 `.proto` files will continue to work without changes. For
206-
those interested in adopting Protobuf Editions, see the updated
207-
[Protobuf format documentation](https://nightlies.apache.org/flink/flink-docs-release-2.1/docs/connectors/table/formats/protobuf/)
208-
for examples and guidance.

flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/protobuf/PatchedProtoWriteSupport.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
*
8080
* <p>The original source can be found here:
8181
* https://github.com/apache/parquet-java/blob/apache-parquet-1.15.2/parquet-protobuf/src/main/java/org/apache/parquet/proto/ProtoWriteSupport.java
82+
*
83+
* <p>Patched code is marked with BEGIN PATCH / END PATCH comments in the source.
8284
*/
8385
class PatchedProtoWriteSupport<T extends MessageOrBuilder> extends WriteSupport<T> {
8486

@@ -469,7 +471,9 @@ final void writeField(Object value) {
469471

470472
private void writeAllFields(MessageOrBuilder pb) {
471473
Descriptor messageDescriptor = pb.getDescriptorForType();
472-
// PATCH: Use string-based syntax detection instead of enum (protobuf 4.x compatibility)
474+
// ============================================================================
475+
// BEGIN PATCH: Replace enum-based syntax detection with string-based approach
476+
// ============================================================================
473477
String syntax = messageDescriptor.getFile().toProto().getSyntax();
474478

475479
// Check for editions syntax (not supported)
@@ -482,6 +486,9 @@ private void writeAllFields(MessageOrBuilder pb) {
482486
boolean isProto2 = syntax.isEmpty() || "proto2".equals(syntax);
483487

484488
if (isProto2) {
489+
// ============================================================================
490+
// END PATCH
491+
// ============================================================================
485492
// Returns changed fields with values. Map is ordered by id.
486493
Map<FieldDescriptor, Object> changedPbFields = pb.getAllFields();
487494

0 commit comments

Comments
 (0)