use of org.apache.flink.table.data.binary.BinaryRowData in project flink by apache.
the class RowDataSerializerTest method getTestData.
@Override
protected RowData[] getTestData() {
RowData row1 = StreamRecordUtils.row(null, 1L);
BinaryRowData row2 = StreamRecordUtils.binaryrow(1L, null);
return new RowData[] { row1, row2 };
}
use of org.apache.flink.table.data.binary.BinaryRowData in project flink by apache.
the class RowDataSerializerTest method deepEqualsRowData.
private static boolean deepEqualsRowData(RowData should, RowData is, RowDataSerializer serializer1, RowDataSerializer serializer2) {
if (should.getArity() != is.getArity()) {
return false;
}
BinaryRowData row1 = serializer1.toBinaryRow(should);
BinaryRowData row2 = serializer2.toBinaryRow(is);
return Objects.equals(row1, row2);
}
use of org.apache.flink.table.data.binary.BinaryRowData in project flink by apache.
the class BaseMaterializedResultTest method createInternalBinaryRowDataConverter.
static Function<Row, BinaryRowData> createInternalBinaryRowDataConverter(DataType dataType) {
DataStructureConverter<Object, Object> converter = DataStructureConverters.getConverter(dataType);
RowDataSerializer serializer = new RowDataSerializer((RowType) dataType.getLogicalType());
return row -> serializer.toBinaryRow((RowData) converter.toInternalOrNull(row)).copy();
}
use of org.apache.flink.table.data.binary.BinaryRowData in project flink by apache.
the class RangeUnboundedFollowingOverFrame method process.
@Override
public RowData process(int index, RowData current) throws Exception {
boolean bufferUpdated = index == 0;
// Ignore all the rows from the buffer for which the input row value is smaller than
// the output row lower bound.
ResettableExternalBuffer.BufferIterator iterator = input.newIterator(inputIndex);
BinaryRowData nextRow = OverWindowFrame.getNextOrNull(iterator);
while (nextRow != null && lbound.compare(nextRow, current) < 0) {
inputIndex += 1;
bufferUpdated = true;
nextRow = OverWindowFrame.getNextOrNull(iterator);
}
return accumulateIterator(bufferUpdated, nextRow, iterator);
}
use of org.apache.flink.table.data.binary.BinaryRowData in project flink by apache.
the class BufferDataOverWindowOperator method processCurrentData.
private void processCurrentData() throws Exception {
currentData.complete();
for (OverWindowFrame frame : overWindowFrames) {
frame.prepare(currentData);
}
int rowIndex = 0;
ResettableExternalBuffer.BufferIterator bufferIterator = currentData.newIterator();
while (bufferIterator.advanceNext()) {
BinaryRowData currentRow = bufferIterator.getRow();
RowData output = currentRow;
// JoinedRowData is slow.
for (int i = 0; i < overWindowFrames.length; i++) {
OverWindowFrame frame = overWindowFrames[i];
RowData value = frame.process(rowIndex, currentRow);
output = joinedRows[i].replace(output, value);
}
collector.collect(output);
rowIndex += 1;
}
bufferIterator.close();
currentData.reset();
}
Aggregations