use of org.apache.flink.table.data.GenericRowData in project flink by apache.
the class LookupJoinRunner method open.
@Override
public void open(Configuration parameters) throws Exception {
super.open(parameters);
this.fetcher = generatedFetcher.newInstance(getRuntimeContext().getUserCodeClassLoader());
this.collector = generatedCollector.newInstance(getRuntimeContext().getUserCodeClassLoader());
FunctionUtils.setFunctionRuntimeContext(fetcher, getRuntimeContext());
FunctionUtils.setFunctionRuntimeContext(collector, getRuntimeContext());
FunctionUtils.openFunction(fetcher, parameters);
FunctionUtils.openFunction(collector, parameters);
this.nullRow = new GenericRowData(tableFieldsCount);
this.outRow = new JoinedRowData();
}
use of org.apache.flink.table.data.GenericRowData in project flink by apache.
the class TemporalRowTimeJoinOperator method open.
@Override
public void open() throws Exception {
super.open();
joinCondition = generatedJoinCondition.newInstance(getRuntimeContext().getUserCodeClassLoader());
joinCondition.setRuntimeContext(getRuntimeContext());
joinCondition.open(new Configuration());
nextLeftIndex = getRuntimeContext().getState(new ValueStateDescriptor<>(NEXT_LEFT_INDEX_STATE_NAME, Types.LONG));
leftState = getRuntimeContext().getMapState(new MapStateDescriptor<>(LEFT_STATE_NAME, Types.LONG, leftType));
rightState = getRuntimeContext().getMapState(new MapStateDescriptor<>(RIGHT_STATE_NAME, Types.LONG, rightType));
registeredTimer = getRuntimeContext().getState(new ValueStateDescriptor<>(REGISTERED_TIMER_STATE_NAME, Types.LONG));
timerService = getInternalTimerService(TIMERS_STATE_NAME, VoidNamespaceSerializer.INSTANCE, this);
outRow = new JoinedRowData();
rightNullRow = new GenericRowData(rightType.toRowType().getFieldCount());
collector = new TimestampedCollector<>(output);
}
use of org.apache.flink.table.data.GenericRowData in project flink by apache.
the class AbstractTopNFunction method createOutputRow.
private RowData createOutputRow(RowData inputRow, long rank, RowKind rowKind) {
if (outputRankNumber) {
GenericRowData rankRow = new GenericRowData(1);
rankRow.setField(0, rank);
outputRow.replace(inputRow, rankRow);
outputRow.setRowKind(rowKind);
return outputRow;
} else {
inputRow.setRowKind(rowKind);
return inputRow;
}
}
use of org.apache.flink.table.data.GenericRowData in project flink by apache.
the class TemporalProcessTimeJoinOperator method open.
@Override
public void open() throws Exception {
super.open();
this.joinCondition = generatedJoinCondition.newInstance(getRuntimeContext().getUserCodeClassLoader());
FunctionUtils.setFunctionRuntimeContext(joinCondition, getRuntimeContext());
FunctionUtils.openFunction(joinCondition, new Configuration());
ValueStateDescriptor<RowData> rightStateDesc = new ValueStateDescriptor<>("right", rightType);
this.rightState = getRuntimeContext().getState(rightStateDesc);
this.collector = new TimestampedCollector<>(output);
this.outRow = new JoinedRowData();
this.rightNullRow = new GenericRowData(rightType.toRowSize());
// consider watermark from left stream only.
super.processWatermark2(Watermark.MAX_WATERMARK);
}
use of org.apache.flink.table.data.GenericRowData in project flink by apache.
the class SinkUpsertMaterializerTest method getEmittedRows.
private static List<RowData> getEmittedRows(OneInputStreamOperatorTestHarness<RowData, RowData> harness) {
final List<RowData> rows = new ArrayList<>();
Object o;
while ((o = harness.getOutput().poll()) != null) {
RowData value = (RowData) ((StreamRecord<?>) o).getValue();
GenericRowData newRow = GenericRowData.of(value.getInt(0), value.getString(1));
newRow.setRowKind(value.getRowKind());
rows.add(newRow);
}
return rows;
}
Aggregations