@Override public void putRow(BytesWritable currentKey, BytesWritable currentValue) throws HiveException, IOException { if (!stringCommon.adaptPutRow(this, currentKey, currentValue)) { // Ignore NULL keys, except for FULL OUTER. if (isFullOuter) { addFullOuterNullKeyValue(currentValue); } } }
@Test public void testStringRowsClipped() throws Exception { random = new Random(326232); // Use a large capacity that doesn't require expansion, yet. VectorMapJoinFastStringHashMap map = new VectorMapJoinFastStringHashMap( false, LARGE_CAPACITY, LOAD_FACTOR, LARGE_WB_SIZE, -1); VerifyFastRowHashMap verifyTable = new VerifyFastRowHashMap(); VectorRandomRowSource valueSource = new VectorRandomRowSource(); valueSource.init( random, VectorRandomRowSource.SupportedTypes.ALL, 4, /* allowNulls */ false, /* isUnicodeOk */ false); int rowCount = 1000; Object[][] rows = valueSource.randomRows(rowCount); addAndVerifyRows(valueSource, rows, map, HashTableKeyType.STRING, verifyTable, new String[] { "string" }, /* doClipping */ true, /* useExactBytes */ false); }
Object keyObject = keyRow[0]; VectorMapJoinFastStringHashMap stringHashMap = (VectorMapJoinFastStringHashMap) map; hashMapResult = stringHashMap.createHashMapResult(); Text text = (Text) keyObject; byte[] bytes = text.getBytes(); int length = text.getLength(); joinResult = stringHashMap.lookup(bytes, 0, length, hashMapResult); if (joinResult != JoinUtil.JoinResult.MATCH) { assertTrue(false);
@Test public void testStringRows() throws Exception { random = new Random(927337); // Use a large capacity that doesn't require expansion, yet. VectorMapJoinFastStringHashMap map = new VectorMapJoinFastStringHashMap( false, LARGE_CAPACITY, LOAD_FACTOR, LARGE_WB_SIZE, -1); VerifyFastRowHashMap verifyTable = new VerifyFastRowHashMap(); VectorRandomRowSource valueSource = new VectorRandomRowSource(); valueSource.init( random, VectorRandomRowSource.SupportedTypes.ALL, 4, /* allowNulls */ false, /* isUnicodeOk */ false); int rowCount = 1000; Object[][] rows = valueSource.randomRows(rowCount); addAndVerifyRows(valueSource, rows, map, HashTableKeyType.STRING, verifyTable, new String[] { "string" }, /* doClipping */ false, /* useExactBytes */ false); }
@Test public void testStringRowsExact() throws Exception { random = new Random(8235); // Use a large capacity that doesn't require expansion, yet. VectorMapJoinFastStringHashMap map = new VectorMapJoinFastStringHashMap( false, LARGE_CAPACITY, LOAD_FACTOR, LARGE_WB_SIZE, -1); VerifyFastRowHashMap verifyTable = new VerifyFastRowHashMap(); VectorRandomRowSource valueSource = new VectorRandomRowSource(); valueSource.init( random, VectorRandomRowSource.SupportedTypes.ALL, 4, /* allowNulls */ false, /* isUnicodeOk */ false); int rowCount = 1000; Object[][] rows = valueSource.randomRows(rowCount); addAndVerifyRows(valueSource, rows, map, HashTableKeyType.STRING, verifyTable, new String[] { "string" }, /* doClipping */ false, /* useExactBytes */ true); }
@Test public void testStringRowsClippedExact() throws Exception { random = new Random(7539); // Use a large capacity that doesn't require expansion, yet. VectorMapJoinFastStringHashMap map = new VectorMapJoinFastStringHashMap( false, LARGE_CAPACITY, LOAD_FACTOR, LARGE_WB_SIZE, -1); VerifyFastRowHashMap verifyTable = new VerifyFastRowHashMap(); VectorRandomRowSource valueSource = new VectorRandomRowSource(); valueSource.init( random, VectorRandomRowSource.SupportedTypes.ALL, 4, /* allowNulls */ false, /* isUnicodeOk */ false); int rowCount = 1000; Object[][] rows = valueSource.randomRows(rowCount); addAndVerifyRows(valueSource, rows, map, HashTableKeyType.STRING, verifyTable, new String[] { "string" }, /* doClipping */ true, /* useExactBytes */ true); }
switch (hashTableKind) { case HASH_MAP: hashTable = new VectorMapJoinFastStringHashMap( isFullOuter, newThreshold, loadFactor, writeBufferSize, estimatedKeyCount);
switch (hashTableKind) { case HASH_MAP: hashTable = new VectorMapJoinFastStringHashMap( isOuterJoin, newThreshold, loadFactor, writeBufferSize, estimatedKeyCount);
switch (hashTableKind) { case HASH_MAP: hashTable = new VectorMapJoinFastStringHashMap( isOuterJoin, newThreshold, loadFactor, writeBufferSize);