[FLINK-39401][formats] Port raw line-delimiter option to release-1.15#28048
Open
featzhang wants to merge 3 commits intoapache:release-1.15from
Open
[FLINK-39401][formats] Port raw line-delimiter option to release-1.15#28048featzhang wants to merge 3 commits intoapache:release-1.15from
featzhang wants to merge 3 commits intoapache:release-1.15from
Conversation
Port PR apache#27897 from master to release-1.15. Extends the raw format to support an optional 'raw.line-delimiter' configuration option: - Deserialization: splits each incoming message by the delimiter using a pre-compiled Pattern and emits one RowData per segment. Null messages with delimiter produce zero rows. Trailing delimiter is stripped to ensure round-trip compatibility. - Serialization: appends delimiter bytes (pre-computed) after each serialized value. - Backward compatible: all existing behavior preserved when raw.line-delimiter is not set. Changes: - RawFormatOptions: add LINE_DELIMITER ConfigOption (no default value) - RawFormatFactory: read option, pass to schema builders, register in optionalOptions() - RawFormatDeserializationSchema: add lineDelimiter + lineDelimiterPattern fields, new 5-arg constructor, override deserialize(byte[], Collector) - RawFormatSerializationSchema: add lineDelimiter + delimiterBytes fields, new 4-arg constructor, append delimiter in serialize() - RawFormatFactoryTest: add testLineDelimiterOption() - RawFormatLineDelimiterTest: new test class with 9 tests (JUnit 4)
Collaborator
Contributor
|
@featzhang flinkbot is acting weirdly. Try making a empty comment. git commit -m "trigger" --allow-empty. |
spuru9
approved these changes
Apr 27, 2026
CI failures on previous build are unrelated to this PR: - Azure agent pool image label missing for release-1.15 pipeline - Pre-existing flaky WikipediaEditsSourceTest (external IRC dependency) Empty commit to re-trigger Azure CI.
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.
What is the purpose of the change
Port PR #27897 (FLINK-39401) from
mastertorelease-1.15. Extends therawformat with an optionalraw.line-delimiterconfiguration that lets each Kafka/file message encode multiple records separated by a delimiter.Brief change log
RawFormatOptions: addLINE_DELIMITERConfigOption(no default, supports Java escape sequences like\n,\r\n).RawFormatFactory: read the option, register it inoptionalOptions(), and pass it to the (de)serialization schemas.RawFormatDeserializationSchema:@Nullable String lineDelimiter; the previous 4-arg constructor delegates withnullfor backward compatibility.Patternfor splitting; newdeserialize(byte[], Collector<RowData>)override emits oneRowDataper segment.RawFormatSerializationSchema:@Nullable String lineDelimiter; old 3-arg constructor delegates withnull.delimiterBytes;serialize()appends them after the value bytes.nullrow still returnsnull.Verifying this change
Added tests:
RawFormatFactoryTest.testLineDelimiterOption— verifies the factory wires the option through correctly.RawFormatLineDelimiterTest(new, 11 tests) — covers:\n/ with multi-char / with GBK charset delimiters\n/ with custom delimiter, null rowRun:
Result:
Tests run: 51, Failures: 0, Errors: 0, Skipped: 0(11 new + 7 factory + 33 existing SerDe).Does this pull request potentially affect one of the following parts:
@Public(Evolving): no (new option is additive, behavior unchanged when unset)deserialize/serialize. When the option is unset, the behavior and allocations are unchanged; when set, a pre-compiledPatternand pre-computedbyte[]avoid per-record allocation.Documentation
LINE_DELIMITERoption; not porting the website docs update from [FLINK-39401] Extend raw format to support line-delimiter option #27897 sincerelease-1.15docs are frozen. Happy to add if desired.