use of org.apache.hadoop.hive.ql.exec.vector.mapjoin.fast.VectorMapJoinFastLongHashMap in project hive by apache.
the class TestVectorMapJoinFastLongHashMap method testMultipleKeysSingleValue.
@Test
public void testMultipleKeysSingleValue() throws Exception {
random = new Random(900);
VectorMapJoinFastLongHashMap map = new VectorMapJoinFastLongHashMap(false, false, HashTableKeyType.LONG, CAPACITY, LOAD_FACTOR, WB_SIZE, -1);
VerifyFastLongHashMap verifyTable = new VerifyFastLongHashMap();
int keyCount = 100 + random.nextInt(1000);
for (int i = 0; i < keyCount; i++) {
long key;
while (true) {
key = random.nextLong();
if (!verifyTable.contains(key)) {
// Unique keys for this test.
break;
}
}
byte[] value = new byte[random.nextInt(MAX_VALUE_LENGTH)];
random.nextBytes(value);
map.testPutRow(key, value);
verifyTable.add(key, value);
// verifyTable.verify(map);
}
verifyTable.verify(map);
}
use of org.apache.hadoop.hive.ql.exec.vector.mapjoin.fast.VectorMapJoinFastLongHashMap in project hive by apache.
the class TestVectorMapJoinFastLongHashMap method testMultipleKeysMultipleValue.
@Test
public void testMultipleKeysMultipleValue() throws Exception {
random = new Random(8);
// Use a large capacity that doesn't require expansion, yet.
VectorMapJoinFastLongHashMap map = new VectorMapJoinFastLongHashMap(false, false, HashTableKeyType.LONG, LARGE_CAPACITY, LOAD_FACTOR, LARGE_WB_SIZE, -1);
VerifyFastLongHashMap verifyTable = new VerifyFastLongHashMap();
int keyCount = 1000;
addAndVerifyMultipleKeyMultipleValue(keyCount, map, verifyTable);
}
Aggregations