[GLUTEN-12459][FLINK] feat: supprt RowKind via $row_kind TINYINT column between Flink and Velox#12510
Open
ggjh-159 wants to merge 3 commits into
Open
[GLUTEN-12459][FLINK] feat: supprt RowKind via $row_kind TINYINT column between Flink and Velox#12510ggjh-159 wants to merge 3 commits into
ggjh-159 wants to merge 3 commits into
Conversation
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.
Related issue: #12459
What changes are proposed in this pull request?
Flink
RowDatacarries aRowKindheader (+I/-U/+U/-D, byte ordinals 0/1/2/3) that today is lost the moment a row is converted to a veloxRowVector. As a result every row exiting the velox pipeline is stamped+I, retract sinks print wrong prefixes, and any future retract-aware operator loses its input signal.This PR threads RowKind through the conversion layer as a trailing TINYINT column named
$row_kind, matching the convention already used on the velox side (kRowKindColumnNameinvelox/experimental/stateful/RowKind.h,ChangelogRowVector::toMergedRowVector). The user-visible schema is unchanged; the extra column is appended/stripped at the Flink boundary.Changes:
ArrowVectorWriter: addTinyIntVectorWriter+ TINYINT →ArrowType.Int(8, true)mapping so TINYINT columns can be written fromRowData.getByte(...).ArrowVectorAccessor: addTinyIntVectorAccessorso TINYINT columns can be read back asbyte.FlinkRowToVLVectorConvertor:fromRowDatanow appends a single-row$row_kindTINYINT vector populated fromrow.getRowKind().toByteValue().toRowDatareads onlyrowType.size()user fields, then looks at the trailing column. If it is the$row_kindTINYINT vector, each row is reconstructed withGenericRowData.ofKind(...); otherwise the previousGenericRowData.of(...)path is taken (INSERT only), preserving backwards compatibility with append-only streams that never carry the column.How was this patch tested?
Depends on the velox4j(bigo-sg/velox4j#57).