use of org.apache.flink.table.runtime.util.UniformBinaryRowGenerator in project flink by apache.
the class BinaryHashTableTest method testHashWithBuildSideOuterJoin1.
@Test
public void testHashWithBuildSideOuterJoin1() throws Exception {
final int numKeys = 20000;
final int buildValsPerKey = 1;
final int probeValsPerKey = 1;
// create a build input that gives 40000 pairs with 1 values sharing the same key
MutableObjectIterator<BinaryRowData> buildInput = new UniformBinaryRowGenerator(2 * numKeys, buildValsPerKey, false);
// create a probe input that gives 20000 pairs with 1 values sharing a key
MutableObjectIterator<BinaryRowData> probeInput = new UniformBinaryRowGenerator(numKeys, probeValsPerKey, true);
MemoryManager memManager = MemoryManagerBuilder.newBuilder().setMemorySize(35 * PAGE_SIZE).build();
// allocate the memory for the HashTable
final BinaryHashTable table = new BinaryHashTable(conf, new Object(), this.buildSideSerializer, this.probeSideSerializer, new MyProjection(), new MyProjection(), memManager, 35 * PAGE_SIZE, ioManager, 24, 200000, true, HashJoinType.BUILD_OUTER, null, true, new boolean[] { true }, false);
int numRecordsInJoinResult = join(table, buildInput, probeInput, true);
Assert.assertEquals("Wrong number of records in join result.", 2 * numKeys * buildValsPerKey * probeValsPerKey, numRecordsInJoinResult);
table.close();
table.free();
}
Aggregations