use of org.apache.flink.table.runtime.operators.sink.StreamRecordTimestampInserter in project flink by apache.
the class StreamExecMatch method translateOrder.
private Transformation<RowData> translateOrder(Transformation<RowData> inputTransform, RowType inputRowType) {
SortSpec.SortFieldSpec timeOrderField = matchSpec.getOrderKeys().getFieldSpec(0);
int timeOrderFieldIdx = timeOrderField.getFieldIndex();
LogicalType timeOrderFieldType = inputRowType.getTypeAt(timeOrderFieldIdx);
if (TypeCheckUtils.isRowTime(timeOrderFieldType)) {
// copy the rowtime field into the StreamRecord timestamp field
int precision = getPrecision(timeOrderFieldType);
Transformation<RowData> transform = ExecNodeUtil.createOneInputTransformation(inputTransform, new TransformationMetadata(createTransformationUid(TIMESTAMP_INSERTER_TRANSFORMATION), "StreamRecordTimestampInserter", String.format("StreamRecordTimestampInserter(rowtime field: %s)", timeOrderFieldIdx)), new StreamRecordTimestampInserter(timeOrderFieldIdx, precision), inputTransform.getOutputType(), inputTransform.getParallelism());
if (inputsContainSingleton()) {
transform.setParallelism(1);
transform.setMaxParallelism(1);
}
return transform;
} else {
return inputTransform;
}
}
Aggregations