use of org.apache.flink.table.runtime.typeutils.BinaryRowDataSerializer in project flink by apache.
the class BinaryExternalSorterTest method beforeTest.
@SuppressWarnings("unchecked")
@Before
public void beforeTest() {
this.memoryManager = MemoryManagerBuilder.newBuilder().setMemorySize(MEMORY_SIZE).build();
this.serializer = new BinaryRowDataSerializer(2);
this.conf.setInteger(ExecutionConfigOptions.TABLE_EXEC_SORT_MAX_NUM_FILE_HANDLES, 128);
}
use of org.apache.flink.table.runtime.typeutils.BinaryRowDataSerializer in project flink by apache.
the class BufferedKVExternalSorterTest method beforeTest.
@Before
public void beforeTest() throws InstantiationException, IllegalAccessException {
this.ioManager = new IOManagerAsync();
this.keySerializer = new BinaryRowDataSerializer(2);
this.valueSerializer = new BinaryRowDataSerializer(2);
this.computer = IntNormalizedKeyComputer.INSTANCE;
this.comparator = IntRecordComparator.INSTANCE;
}
use of org.apache.flink.table.runtime.typeutils.BinaryRowDataSerializer in project flink by apache.
the class SortMergeJoinIteratorTest method oneSideOuter.
public void oneSideOuter(Tuple2<MutableObjectIterator<BinaryRowData>, MutableObjectIterator<BinaryRowData>> data, List<Tuple2<BinaryRowData, BinaryRowData>> compare) throws Exception {
MutableObjectIterator input1 = data.f0;
MutableObjectIterator input2 = data.f1;
if (leftIsSmall) {
input1 = data.f1;
input2 = data.f0;
}
try (SortMergeOneSideOuterJoinIterator iterator = new SortMergeOneSideOuterJoinIterator(new BinaryRowDataSerializer(1), new BinaryRowDataSerializer(1), new MyProjection(), new MyProjection(), new IntRecordComparator(), input1, input2, new ResettableExternalBuffer(ioManager, new LazyMemorySegmentPool(this, memManager, BUFFER_MEMORY), serializer, false), new boolean[] { true })) {
int id = 0;
while (iterator.nextOuterJoin()) {
RowData probe = iterator.getProbeRow();
if (iterator.matchKey == null) {
Tuple2<BinaryRowData, BinaryRowData> expected = compare.get(id++);
if (leftIsSmall) {
assertEquals(expected, new Tuple2<>(null, probe));
} else {
assertEquals(expected, new Tuple2<>(probe, null));
}
} else {
ResettableExternalBuffer.BufferIterator iter = iterator.getMatchBuffer().newIterator();
while (iter.advanceNext()) {
RowData row = iter.getRow();
Tuple2<BinaryRowData, BinaryRowData> expected = compare.get(id++);
assertEquals(expected, new Tuple2<>(row, probe));
}
}
}
assertEquals(compare.size(), id);
}
}
use of org.apache.flink.table.runtime.typeutils.BinaryRowDataSerializer in project flink by apache.
the class SortMergeJoinIteratorTest method inner.
public void inner(Tuple2<MutableObjectIterator<BinaryRowData>, MutableObjectIterator<BinaryRowData>> data, List<Tuple2<BinaryRowData, BinaryRowData>> compare) throws Exception {
MutableObjectIterator input1 = data.f0;
MutableObjectIterator input2 = data.f1;
if (leftIsSmall) {
input1 = data.f1;
input2 = data.f0;
}
try (SortMergeInnerJoinIterator iterator = new SortMergeInnerJoinIterator(new BinaryRowDataSerializer(1), new BinaryRowDataSerializer(1), new MyProjection(), new MyProjection(), new IntRecordComparator(), input1, input2, new ResettableExternalBuffer(ioManager, new LazyMemorySegmentPool(this, memManager, BUFFER_MEMORY), serializer, false), new boolean[] { true })) {
int id = 0;
while (iterator.nextInnerJoin()) {
RowData probe = iterator.getProbeRow();
ResettableExternalBuffer.BufferIterator iter = iterator.getMatchBuffer().newIterator();
while (iter.advanceNext()) {
RowData row = iter.getRow();
Tuple2<BinaryRowData, BinaryRowData> expected = compare.get(id++);
if (leftIsSmall) {
assertEquals(expected, new Tuple2<>(row, probe));
} else {
assertEquals(expected, new Tuple2<>(probe, row));
}
}
}
assertEquals(compare.size(), id);
}
}
use of org.apache.flink.table.runtime.typeutils.BinaryRowDataSerializer in project flink by apache.
the class SortMergeJoinIteratorTest method before.
@Before
public void before() throws MemoryAllocationException {
this.memManager = MemoryManagerBuilder.newBuilder().setMemorySize(MEMORY_SIZE).build();
this.ioManager = new IOManagerAsync();
this.serializer = new BinaryRowDataSerializer(1);
}
Aggregations