goutamadwant opened a new pull request, #12039:
URL: https://github.com/apache/seatunnel/pull/12039

   ### Purpose of this pull request
   
   Closes #12037.
   
   Confluent-framed Protobuf records can have a zero-byte data section when the 
message is empty or all proto3 implicit-presence fields contain default values. 
The existing Schema Registry-aware deserializer rejected every payload smaller 
than two bytes and then retried the complete frame as plain Protobuf, causing 
valid empty messages to fail with an invalid-tag error.
   
   This change structurally decodes the Confluent zigzag-varint message-index 
vector and permits an empty data section only after the complete header is 
valid. It preserves plain-Protobuf fallback and retains the previous bounded 
probe for non-empty compatibility.
   
   No dependency, public API, configuration, or default is changed.
   
   Regression coverage includes:
   
   - Optimized `[0]` and explicit single-index framing.
   - Empty messages and all-default proto3 messages.
   - Non-empty and nested/multi-index payloads.
   - Plain Protobuf fallback.
   - Legacy non-empty framing.
   - Truncated, negative, oversized, malformed, and invalid-magic headers.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes.
   
   Previously, a Kafka source configured with `format = protobuf` and 
`strip_schema_registry_header = true` failed to deserialize a valid Schema 
Registry record when its Protobuf data section contained zero bytes.
   
   After this change, the record is deserialized into the schema's 
default-valued row when the Confluent header is structurally valid. Existing 
non-empty Schema Registry records and plain Protobuf records retain their 
previous behavior.
   
   ### How was this patch tested?
   
   The complete Protobuf format module was tested on both Java versions using:
   
   - `./mvnw -pl seatunnel-formats/seatunnel-format-protobuf test`
   - `./mvnw -pl seatunnel-formats/seatunnel-format-protobuf -DskipTests verify`
   - `./mvnw -pl seatunnel-formats/seatunnel-format-protobuf spotless:apply`
   
   Results:
   
   - Oracle Java 8: 19 tests, 0 failures, 0 errors.
   - Eclipse Temurin Java 11: 19 tests, 0 failures, 0 errors.
   - `git diff --check`: passed.
   
   A repository-wide Java 11 `./mvnw -q -DskipTests verify` reached the 
unrelated `seatunnel-engine-ui` module and stopped because its npm process-tree 
helper could not spawn a child process (`spawn EPERM`). This PR does not change 
UI files.
   
   ### Check list
   
   * [x] No new Jar binary package is added.
   * [x] Documentation does not require an update because the existing Kafka 
documentation already defines Schema Registry header stripping; this patch 
corrects that documented behavior.
   * [x] `incompatible-changes.md` does not require an update because this is 
backward-compatible.
   * [x] The connector contribution checklist is not applicable because this is 
a focused fix to an existing shared format implementation and adds no connector 
or plugin.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to