feat: Add StreamRecordTimestampInserter operator#64
Merged
lgbo-ustc merged 5 commits intoJul 14, 2026
Merged
Conversation
This was referenced Jul 2, 2026
KevinyhZou
reviewed
Jul 3, 2026
| 1, | ||
| "Expected single-column timestamp vector from wrapped FilterProject"); | ||
| auto child = timestampVector->childAt(0); | ||
| auto tsVector = child->as<SimpleVector<Timestamp>>(); |
There was a problem hiding this comment.
The result of watermark::getTimestampVector(...) should be SimpleVector<int64_t> ? and this can be seen from WatermarkGenerator and WatermarkAssigner
Author
There was a problem hiding this comment.
In Flink file org/apache/flink/table/runtime/operators/sink/StreamRecordTimestampInserter.java
@Override
public void processElement(StreamRecord<RowData> element) throws Exception {
final RowData rowData = element.getValue();
// timestamp might be TIMESTAMP or TIMESTAMP_LTZ
final long rowtime = rowData.getTimestamp(rowtimeIndex, precision).getMillisecond();
element.setTimestamp(rowtime);
output.collect(element);
}The type of the column vector at index rowtimeIndex should be Timestamp.
| } | ||
|
|
||
| pushOutput(std::make_shared<StreamRecord>( | ||
| getPlanNodeId(), std::move(input_), maxTs)); |
There was a problem hiding this comment.
if input.size == 0, then maxTs = std::numeric_limits<int64_t>::min(), StreamRecord.hasTImestamp should be false
…stream-record-timestamp-inserter
|
format the code |
Author
@lgbo-ustc cc |
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.
Issue: gluten#12426
Summary
Adds a new stateful operator
StreamRecordTimestampInsertertovelox/experimental/stateful/, the native counterpart of Flink'sorg.apache.flink.table.runtime.operators.sink.StreamRecordTimestampInserter.Unlike the row-based Flink original (which reads the rowtime column row-by-row and stamps each
StreamRecord), this operator works in columnar batches:RowVectorwrapped in aStreamRecordcarrying that timestampNo watermark generation, no batch splitting —
RowVectorpasses through end-to-end. Operator logic and plan node live entirely in C++.Changes
velox/experimental/stateful/StreamRecordTimestampInserter.{h,cpp}— operator implementation.velox/experimental/stateful/StatefulPlanNode.{h,cpp}— addsStreamRecordTimestampInserterNodePlanNode withproject+rowtimeFieldIndexfields, registers serde ("StreamRecordTimestampInserterNode").velox/experimental/stateful/StatefulPlanner.{h,cpp}— adds dispatch +transformStreamRecordTimestampInserterOperator.velox/experimental/stateful/CMakeLists.txt— addsStreamRecordTimestampInserter.cpptovelox_stateful_exec.velox/experimental/stateful/tests/StreamRecordTimestampInserterTest.cpp+ CMakeLists entry — unit tests.Test plan