hashMapResult.isCappedCountAvailable() && hashMapResult.cappedCount() > overflowRepeatedThreshold) { ByteSegmentRef byteSegmentRef = hashMapResult.first(); while (byteSegmentRef != null) { forwardOverflow(); byteSegmentRef = hashMapResult.next();
@Override public void forget() { bytesBytesMultiHashMapResult.forget(); super.forget(); }
/** * Generate optimized results when entire batch key is repeated and it matched the hash map. * * @param batch * The big table batch. * @param hashMapResult * The hash map results for the repeated key. */ protected void generateHashMapResultRepeatedAll(VectorizedRowBatch batch, VectorMapJoinHashMapResult hashMapResult) throws IOException, HiveException { int[] selected = batch.selected; if (batch.selectedInUse) { // The selected array is already filled in as we want it. } else { for (int i = 0; i < batch.size; i++) { selected[i] = i; } batch.selectedInUse = true; } int numSel = 0; if (hashMapResult.isSingleRow()) { numSel = generateHashMapResultSingleValue(batch, hashMapResult, batch.selected, 0, batch.size, numSel); } else { generateHashMapResultMultiValue(batch, hashMapResult, batch.selected, 0, batch.size); } batch.size = numSel; }
final int columnCount = typeInfos.length; WriteBuffers.ByteSegmentRef ref = hashMapResult.first(); lazyBinaryDeserializeRead.getDetailedReadPositionString(); hashMapResult.getDetailedHashMapResultPositionString(); ref = hashMapResult.next(); if (a == count - 1) { TestCase.assertTrue (ref == null);
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("(" + super.toString() + ", "); sb.append("cappedCount " + cappedCount() + ")"); return sb.toString(); }
ByteSegmentRef byteSegmentRef = hashMapResult.first();
protected void doSmallTableValueDeserializeRow(VectorizedRowBatch batch, int batchIndex, ByteSegmentRef byteSegmentRef, VectorMapJoinHashMapResult hashMapResult) throws HiveException { byte[] bytes = byteSegmentRef.getBytes(); int offset = (int) byteSegmentRef.getOffset(); int length = byteSegmentRef.getLength(); smallTableValueVectorDeserializeRow.setBytes(bytes, offset, length); try { // Our hash tables are immutable. We can safely do by reference STRING, CHAR/VARCHAR, etc. smallTableValueVectorDeserializeRow.deserializeByRef(batch, batchIndex); } catch (Exception e) { throw new HiveException( "\nHashMapResult detail: " + hashMapResult.getDetailedHashMapResultPositionString() + "\nDeserializeRead detail: " + smallTableValueVectorDeserializeRow.getDetailedReadPositionString(), e); } }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("(" + super.toString() + ", "); sb.append("cappedCount " + cappedCount() + ")"); return sb.toString(); } }
ByteSegmentRef byteSegmentRef = hashMapResult.first();
protected void doSmallTableDeserializeRow(VectorizedRowBatch batch, int batchIndex, ByteSegmentRef byteSegmentRef, VectorMapJoinHashMapResult hashMapResult) throws HiveException { byte[] bytes = byteSegmentRef.getBytes(); int offset = (int) byteSegmentRef.getOffset(); int length = byteSegmentRef.getLength(); smallTableVectorDeserializeRow.setBytes(bytes, offset, length); try { // Our hash tables are immutable. We can safely do by reference STRING, CHAR/VARCHAR, etc. smallTableVectorDeserializeRow.deserializeByRef(batch, batchIndex); } catch (Exception e) { throw new HiveException( "\nHashMapResult detail: " + hashMapResult.getDetailedHashMapResultPositionString() + "\nDeserializeRead detail: " + smallTableVectorDeserializeRow.getDetailedReadPositionString(), e); } }
hashMapResult.isCappedCountAvailable() && hashMapResult.cappedCount() > overflowRepeatedThreshold) { ByteSegmentRef byteSegmentRef = hashMapResult.first(); while (byteSegmentRef != null) { forwardOverflow(); byteSegmentRef = hashMapResult.next();
public static void verifyHashMapRows(List<Object[]> rows, int[] actualToValueMap, VectorMapJoinHashMapResult hashMapResult, TypeInfo[] typeInfos) throws IOException { final int count = rows.size(); final int columnCount = typeInfos.length; WriteBuffers.ByteSegmentRef ref = hashMapResult.first(); for (int a = 0; a < count; a++) { int valueIndex = actualToValueMap[a]; Object[] row = rows.get(valueIndex); byte[] bytes = ref.getBytes(); int offset = (int) ref.getOffset(); int length = ref.getLength(); LazyBinaryDeserializeRead lazyBinaryDeserializeRead = new LazyBinaryDeserializeRead( typeInfos, /* useExternalBuffer */ false); lazyBinaryDeserializeRead.set(bytes, offset, length); for (int index = 0; index < columnCount; index++) { verifyRead(lazyBinaryDeserializeRead, typeInfos[index], row[index]); } TestCase.assertTrue(lazyBinaryDeserializeRead.isEndOfInputReached()); ref = hashMapResult.next(); if (a == count - 1) { TestCase.assertTrue (ref == null); } else { TestCase.assertTrue (ref != null); } } }
/** * Generate optimized results when entire batch key is repeated and it matched the hash map. * * @param batch * The big table batch. * @param hashMapResult * The hash map results for the repeated key. */ protected void generateHashMapResultRepeatedAll(VectorizedRowBatch batch, VectorMapJoinHashMapResult hashMapResult) throws IOException, HiveException { int[] selected = batch.selected; if (batch.selectedInUse) { // The selected array is already filled in as we want it. } else { for (int i = 0; i < batch.size; i++) { selected[i] = i; } batch.selectedInUse = true; } int numSel = 0; if (hashMapResult.isSingleRow()) { numSel = generateHashMapResultSingleValue(batch, hashMapResult, batch.selected, 0, batch.size, numSel); } else { generateHashMapResultMultiValue(batch, hashMapResult, batch.selected, 0, batch.size); } batch.size = numSel; }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("(" + super.toString() + ", "); sb.append("cappedCount " + cappedCount() + ")"); return sb.toString(); } }
ByteSegmentRef byteSegmentRef = hashMapResult.first();
@Override public void forget() { bytesBytesMultiHashMapResult.forget(); super.forget(); }
hashMapResult.isCappedCountAvailable() && hashMapResult.cappedCount() > overflowRepeatedThreshold) { ByteSegmentRef byteSegmentRef = hashMapResult.first(); while (byteSegmentRef != null) { forwardOverflow(); byteSegmentRef = hashMapResult.next();