public void collect(HiveKey key, Object value) throws IOException { sampled.add(Arrays.copyOfRange(key.getBytes(), 0, key.getLength())); }
public void collect(HiveKey key, Object value) throws IOException { sampled.add(Arrays.copyOfRange(key.getBytes(), 0, key.getLength())); }
/** * Try store the non-vectorized key. * @param key Serialized key. * @return TopNHash.FORWARD if the row should be forwarded; * TopNHash.EXCLUDED if the row should be discarded; * any other number if the row is to be stored; the index should be passed to storeValue. */ public int tryStoreKey(HiveKey key, boolean partColsIsNull) throws HiveException, IOException { if (!isEnabled) { return FORWARD; // short-circuit quickly - forward all rows } if (topN == 0) { return EXCLUDE; // short-circuit quickly - eat all rows } int index = insertKeyIntoHeap(key); if (index >= 0) { usage += key.getLength(); return index; } // IndexStore is trying to tell us something. switch (index) { case FORWARD: return FORWARD; case EXCLUDE: return EXCLUDE; // skip the row. default: { assert false; throw new HiveException("Invalid result trying to store the key: " + index); } } }
/** * Try store the non-vectorized key. * @param key Serialized key. * @return TopNHash.FORWARD if the row should be forwarded; * TopNHash.EXCLUDED if the row should be discarded; * any other number if the row is to be stored; the index should be passed to storeValue. */ public int tryStoreKey(HiveKey key, boolean partColsIsNull) throws HiveException, IOException { if (!isEnabled) { return FORWARD; // short-circuit quickly - forward all rows } if (topN == 0) { return EXCLUDE; // short-circuit quickly - eat all rows } int index = insertKeyIntoHeap(key); if (index >= 0) { usage += key.getLength(); return index; } // IndexStore is trying to tell us something. switch (index) { case FORWARD: return FORWARD; case EXCLUDE: return EXCLUDE; // skip the row. default: { assert false; throw new HiveException("Invalid result trying to store the key: " + index); } } }
private void writeHiveKey(Output output, HiveKey hiveKey) { int size = hiveKey.getLength(); output.writeInt(size); output.writeBytes(hiveKey.getBytes(), 0, size); output.writeInt(0); // Since hashCode is not used, just put an arbitrary number output.writeInt(hiveKey.getDistKeyLength()); }
private void writeHiveKey(Output output, HiveKey hiveKey) { int size = hiveKey.getLength(); output.writeInt(size); output.writeBytes(hiveKey.getBytes(), 0, size); output.writeInt(0); // Since hashCode is not used, just put an arbitrary number output.writeInt(hiveKey.getDistKeyLength()); }
private void writeHiveKey(Output output, HiveKey hiveKey) { int size = hiveKey.getLength(); output.writeInt(size); output.writeBytes(hiveKey.getBytes(), 0, size); output.writeInt(hiveKey.hashCode()); output.writeInt(hiveKey.getDistKeyLength()); }
private void writeHiveKey(Output output, HiveKey hiveKey) { int size = hiveKey.getLength(); output.writeInt(size); output.writeBytes(hiveKey.getBytes(), 0, size); output.writeInt(hiveKey.hashCode()); output.writeInt(hiveKey.getDistKeyLength()); }
keys[index] = Arrays.copyOf(key.getBytes(), key.getLength()); distKeyLengths[index] = key.getDistKeyLength(); hashes[index] = key.hashCode();
keys[index] = Arrays.copyOf(key.getBytes(), key.getLength()); distKeyLengths[index] = key.getDistKeyLength(); hashes[index] = key.hashCode();
keys[index] = Arrays.copyOf(key.getBytes(), key.getLength()); distKeyLengths[index] = key.getDistKeyLength(); hashes[index] = key.hashCode();
keys[index] = Arrays.copyOf(key.getBytes(), key.getLength()); distKeyLengths[index] = key.getDistKeyLength(); hashes[index] = key.hashCode();
public void collect(HiveKey key, Object value) throws IOException { sampled.add(Arrays.copyOfRange(key.getBytes(), 0, key.getLength())); }
/** * Try store the non-vectorized key. * @param key Serialized key. * @return TopNHash.FORWARD if the row should be forwarded; * TopNHash.EXCLUDED if the row should be discarded; * any other number if the row is to be stored; the index should be passed to storeValue. */ public int tryStoreKey(HiveKey key, boolean partColsIsNull) throws HiveException, IOException { if (!isEnabled) { return FORWARD; // short-circuit quickly - forward all rows } if (topN == 0) { return EXCLUDE; // short-circuit quickly - eat all rows } int index = insertKeyIntoHeap(key); if (index >= 0) { usage += key.getLength(); return index; } // IndexStore is trying to tell us something. switch (index) { case FORWARD: return FORWARD; case EXCLUDE: return EXCLUDE; // skip the row. default: { assert false; throw new HiveException("Invalid result trying to store the key: " + index); } } }
private void writeHiveKey(Output output, HiveKey hiveKey) { int size = hiveKey.getLength(); output.writeInt(size); output.writeBytes(hiveKey.getBytes(), 0, size); output.writeInt(0); // Since hashCode is not used, just put an arbitrary number output.writeInt(hiveKey.getDistKeyLength()); }
private void writeHiveKey(Output output, HiveKey hiveKey) { int size = hiveKey.getLength(); output.writeInt(size); output.writeBytes(hiveKey.getBytes(), 0, size); output.writeInt(hiveKey.hashCode()); output.writeInt(hiveKey.getDistKeyLength()); }
keys[index] = Arrays.copyOf(key.getBytes(), key.getLength()); distKeyLengths[index] = key.getDistKeyLength(); hashes[index] = key.hashCode();