public boolean adaptPutRow(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()); } long key = VectorMapJoinFastLongHashUtil.deserializeLongKey( keyBinarySortableDeserializeRead, hashTableKeyType); add(key, currentValue); return true; }
@Override public JoinResult contains(long key, VectorMapJoinHashSetResult hashSetResult) { VectorMapJoinFastHashSet.HashSetResult optimizedHashSetResult = (VectorMapJoinFastHashSet.HashSetResult) hashSetResult; optimizedHashSetResult.forget(); long hashCode = VectorMapJoinFastLongHashUtil.hashKey(key); long existance = findReadSlot(key, hashCode); JoinUtil.JoinResult joinResult; if (existance == -1) { joinResult = JoinUtil.JoinResult.NOMATCH; } else { joinResult = JoinUtil.JoinResult.MATCH; } optimizedHashSetResult.setJoinResult(joinResult); return joinResult; }
long hashCode = VectorMapJoinFastLongHashUtil.hashKey(tableKey); int intHashCode = (int) hashCode; int newSlot = intHashCode & newLogicalHashBucketMask;
@Override public void putRow(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()); } long key = VectorMapJoinFastLongHashUtil.deserializeLongKey( keyBinarySortableDeserializeRead, hashTableKeyType); add(key, currentValue); }
@Override public JoinUtil.JoinResult contains(long key, VectorMapJoinHashMultiSetResult hashMultiSetResult) { VectorMapJoinFastHashMultiSet.HashMultiSetResult optimizedHashMultiSetResult = (VectorMapJoinFastHashMultiSet.HashMultiSetResult) hashMultiSetResult; optimizedHashMultiSetResult.forget(); long hashCode = VectorMapJoinFastLongHashUtil.hashKey(key); long count = findReadSlot(key, hashCode); JoinUtil.JoinResult joinResult; if (count == -1) { joinResult = JoinUtil.JoinResult.NOMATCH; } else { optimizedHashMultiSetResult.set(count); joinResult = JoinUtil.JoinResult.MATCH; } optimizedHashMultiSetResult.setJoinResult(joinResult); return joinResult; }
@Override public void putRow(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"); } } long key = VectorMapJoinFastLongHashUtil.deserializeLongKey( keyBinarySortableDeserializeRead, hashTableKeyType); add(key, currentValue); }
@Override public JoinUtil.JoinResult lookup(long key, VectorMapJoinHashMapResult hashMapResult) { VectorMapJoinFastValueStore.HashMapResult optimizedHashMapResult = (VectorMapJoinFastValueStore.HashMapResult) hashMapResult; optimizedHashMapResult.forget(); long hashCode = VectorMapJoinFastLongHashUtil.hashKey(key); // LOG.debug("VectorMapJoinFastLongHashMap lookup " + key + " hashCode " + hashCode); long valueRef = findReadSlot(key, hashCode); JoinUtil.JoinResult joinResult; if (valueRef == -1) { joinResult = JoinUtil.JoinResult.NOMATCH; } else { optimizedHashMapResult.set(valueStore, valueRef); joinResult = JoinUtil.JoinResult.MATCH; } optimizedHashMapResult.setJoinResult(joinResult); return joinResult; }
long hashCode = VectorMapJoinFastLongHashUtil.hashKey(key); int intHashCode = (int) hashCode; int slot = (intHashCode & logicalHashBucketMask);