@Override public void putRow(BytesWritable currentKey, BytesWritable currentValue) throws HiveException, IOException { // No deserialization of key(s) here -- just get reference to bytes. byte[] keyBytes = currentKey.getBytes(); int keyLength = currentKey.getLength(); add(keyBytes, 0, keyLength, currentValue); }
public VectorMapJoinFastBytesHashTable( int initialCapacity, float loadFactor, int writeBuffersSize, long estimatedKeyCount) { super(initialCapacity, loadFactor, writeBuffersSize, estimatedKeyCount); allocateBucketArray(); } }
private void allocateBucketArray() { // We cannot go above highest Integer power of 2. if (logicalHashBucketCount > HIGHEST_INT_POWER_OF_2) { throwExpandError(HIGHEST_INT_POWER_OF_2, "Bytes"); } slots = new long[logicalHashBucketCount]; }
public void add(byte[] keyBytes, int keyStart, int keyLength, BytesWritable currentValue) { expandAndRehash(); assignSlot(slot, keyBytes, keyStart, keyLength, hashCode, isNewKey, currentValue);
@Override public long getEstimatedMemorySize() { long size = super.getEstimatedMemorySize(); size += hashMapStore.getEstimatedMemorySize(); return size; } }
@VisibleForTesting public void putRow(byte[] currentKey, byte[] currentValue) throws HiveException, IOException { if (testKeyBytesWritable == null) { testKeyBytesWritable = new BytesWritable(); testValueBytesWritable = new BytesWritable(); } testKeyBytesWritable.set(currentKey, 0, currentKey.length); testValueBytesWritable.set(currentValue, 0, currentValue.length); putRow(testKeyBytesWritable, testValueBytesWritable); }
public void add(byte[] keyBytes, int keyStart, int keyLength, BytesWritable currentValue) { expandAndRehash(); assignSlot(slot, keyBytes, keyStart, keyLength, hashCode, isNewKey, currentValue);
@Override public long getEstimatedMemorySize() { long size = super.getEstimatedMemorySize(); size += hashSetStore.getEstimatedMemorySize(); return size; } }
@Override public void putRow(BytesWritable currentKey, BytesWritable currentValue) throws HiveException, IOException { // No deserialization of key(s) here -- just get reference to bytes. byte[] keyBytes = currentKey.getBytes(); int keyLength = currentKey.getLength(); add(keyBytes, 0, keyLength, currentValue); }
public VectorMapJoinFastBytesHashTable( boolean isFullOuter, int initialCapacity, float loadFactor, int writeBuffersSize, long estimatedKeyCount) { super( isFullOuter, initialCapacity, loadFactor, writeBuffersSize, estimatedKeyCount); unsafeReadPos = new WriteBuffers.Position(); allocateBucketArray(); }
throwExpandError(ONE_SIXTH_LIMIT, "Bytes");
@Override public long getEstimatedMemorySize() { long size = super.getEstimatedMemorySize(); size += hashMultiSetStore.getEstimatedMemorySize(); return size; } }
public boolean adaptPutRow(VectorMapJoinFastBytesHashTable hashTable, BytesWritable currentKey, BytesWritable currentValue) throws HiveException, IOException { byte[] keyBytes = currentKey.getBytes(); int keyLength = currentKey.getLength(); keyBinarySortableDeserializeRead.set(keyBytes, 0, keyLength); try { if (!keyBinarySortableDeserializeRead.readNextField()) { return false; } } catch (Exception e) { throw new HiveException( "\nDeserializeRead details: " + keyBinarySortableDeserializeRead.getDetailedReadPositionString() + "\nException: " + e.toString()); } hashTable.add( keyBinarySortableDeserializeRead.currentBytes, keyBinarySortableDeserializeRead.currentBytesStart, keyBinarySortableDeserializeRead.currentBytesLength, currentValue); return true; }
public VectorMapJoinFastBytesHashTable( int initialCapacity, float loadFactor, int writeBuffersSize) { super(initialCapacity, loadFactor, writeBuffersSize); allocateBucketArray(); } }
throwExpandError(HIGHEST_INT_POWER_OF_2, "Bytes");
public void adaptPutRow(VectorMapJoinFastBytesHashTable hashTable, BytesWritable currentKey, BytesWritable currentValue) throws HiveException, IOException { byte[] keyBytes = currentKey.getBytes(); int keyLength = currentKey.getLength(); keyBinarySortableDeserializeRead.set(keyBytes, 0, keyLength); try { if (!keyBinarySortableDeserializeRead.readNextField()) { return; } } catch (Exception e) { throw new HiveException( "\nDeserializeRead details: " + keyBinarySortableDeserializeRead.getDetailedReadPositionString() + "\nException: " + e.toString()); } hashTable.add( keyBinarySortableDeserializeRead.currentBytes, keyBinarySortableDeserializeRead.currentBytesStart, keyBinarySortableDeserializeRead.currentBytesLength, currentValue); }
@Override public void putRow(BytesWritable currentKey, BytesWritable currentValue) throws HiveException, IOException { // No deserialization of key(s) here -- just get reference to bytes. byte[] keyBytes = currentKey.getBytes(); int keyLength = currentKey.getLength(); add(keyBytes, 0, keyLength, currentValue); }
public void adaptPutRow(VectorMapJoinFastBytesHashTable hashTable, BytesWritable currentKey, BytesWritable currentValue) throws HiveException, IOException { byte[] keyBytes = currentKey.getBytes(); int keyLength = currentKey.getLength(); keyBinarySortableDeserializeRead.set(keyBytes, 0, keyLength); if (keyBinarySortableDeserializeRead.readCheckNull()) { if (isOuterJoin) { return; } else { // For inner join, we expect all NULL values to have been filtered out before now. throw new HiveException("Unexpected NULL in map join small table"); } } keyBinarySortableDeserializeRead.readString(readStringResults); hashTable.add(readStringResults.bytes, readStringResults.start, readStringResults.length, currentValue); }