@Override protected void initializeOp(Configuration hconf) throws HiveException { super.initializeOp(hconf); Preconditions.checkState(!isEmptyKey); // Create all nulls key. try { Output nullKeyOutput = new Output(); keyBinarySortableSerializeWrite.set(nullKeyOutput); for (int i = 0; i < reduceSinkKeyColumnMap.length; i++) { keyBinarySortableSerializeWrite.writeNull(); } int nullBytesLength = nullKeyOutput.getLength(); nullBytes = new byte[nullBytesLength]; System.arraycopy(nullKeyOutput.getData(), 0, nullBytes, 0, nullBytesLength); nullKeyHashCode = HashCodeUtil.calculateBytesHashCode(nullBytes, 0, nullBytesLength); } catch (Exception e) { throw new HiveException(e); } }
void serializeBatch( VectorizedRowBatch batch, VectorSerializeRow vectorSerializeRow, DeserializeRead deserializeRead, VectorRandomRowSource source, Object[][] randomRows, int firstRandomRowIndex) throws HiveException, IOException { Output output = new Output(); for (int i = 0; i < batch.size; i++) { output.reset(); vectorSerializeRow.setOutput(output); vectorSerializeRow.serializeWrite(batch, i); Object[] expectedRow = randomRows[firstRandomRowIndex + i]; byte[] bytes = output.getData(); int length = output.getLength(); char[] chars = new char[length]; for (int c = 0; c < chars.length; c++) { chars[c] = (char) (bytes[c] & 0xFF); } deserializeAndVerify(output, deserializeRead, source, expectedRow); } }
public GetAdaptor() { currentValue = new ReusableRowContainer(); output = new Output(); }
public VectorMapJoinOptimizedLongCommon( boolean minMaxEnabled, boolean isOuterJoin, HashTableKeyType hashTableKeyType) { this.isOuterJoin = isOuterJoin; // useMinMax = minMaxEnabled; min = Long.MAX_VALUE; max = Long.MIN_VALUE; this.hashTableKeyType = hashTableKeyType; keyBinarySortableSerializeWrite = new BinarySortableSerializeWrite(1); output = new Output(); keyBinarySortableSerializeWrite.set(output); serializedBytes = new SerializedBytes(); } }
public GetAdaptor() { currentValue = new ReusableRowContainer(); output = new Output(); }
public VectorKeySeriesSerializedImpl(T serializeWrite) { super(); this.serializeWrite = serializeWrite; output = new Output(); serializedKeyLengths = new int[VectorizedRowBatch.DEFAULT_SIZE]; }
public VectorMapJoinOptimizedStringCommon(boolean isOuterJoin) { // this.isOuterJoin = isOuterJoin; // PrimitiveTypeInfo[] primitiveTypeInfos = { TypeInfoFactory.stringTypeInfo }; // keyBinarySortableDeserializeRead = new BinarySortableDeserializeRead(primitiveTypeInfos); // readStringResults = keyBinarySortableDeserializeRead.createReadStringResults(); // bytesWritable = new BytesWritable(); keyBinarySortableSerializeWrite = new BinarySortableSerializeWrite(1); output = new Output(); keyBinarySortableSerializeWrite.set(output); serializedBytes = new SerializedBytes(); } }
public VectorMapJoinRowBytesContainer(String spillLocalDirs) { output = new Output(); readBuffer = new byte[INPUT_SIZE]; readNextBytes = new byte[MAX_READS][]; readNextOffsets = new int[MAX_READS]; readNextLengths = new int[MAX_READS]; isOpen = false; totalWriteLength = 0; totalReadLength = 0; this.spillLocalDirs = spillLocalDirs; }
public VectorMapJoinOptimizedLongCommon( boolean minMaxEnabled, boolean isOuterJoin, HashTableKeyType hashTableKeyType) { this.isOuterJoin = isOuterJoin; // useMinMax = minMaxEnabled; min = Long.MAX_VALUE; max = Long.MIN_VALUE; this.hashTableKeyType = hashTableKeyType; keyBinarySortableSerializeWrite = new BinarySortableSerializeWrite(1); output = new Output(); keyBinarySortableSerializeWrite.set(output); serializedBytes = new SerializedBytes(); } }
public GetAdaptor() { currentValue = new ReusableRowContainer(); output = new Output(); }
public GetAdaptor() { currentValue = new ReusableRowContainer(); output = new Output(); }
@Override protected void commonSetup() throws HiveException { super.commonSetup(); /* * Initialize Multi-Key members for this specialized class. */ keyVectorSerializeWrite = new VectorSerializeRow( new BinarySortableSerializeWrite(bigTableKeyColumnMap.length)); keyVectorSerializeWrite.init(bigTableKeyTypeInfos, bigTableKeyColumnMap); currentKeyOutput = new Output(); saveKeyOutput = new Output(); }
public VectorMapJoinOptimizedStringCommon(boolean isOuterJoin) { keyBinarySortableSerializeWrite = new BinarySortableSerializeWrite(1); output = new Output(); keyBinarySortableSerializeWrite.set(output); serializedBytes = new SerializedBytes(); } }
@Override protected void commonSetup() throws HiveException { super.commonSetup(); /* * Initialize Multi-Key members for this specialized class. */ keyVectorSerializeWrite = new VectorSerializeRow( new BinarySortableSerializeWrite(bigTableKeyColumnMap.length)); keyVectorSerializeWrite.init(bigTableKeyTypeInfos, bigTableKeyColumnMap); currentKeyOutput = new Output(); saveKeyOutput = new Output(); }
public ByteStreamTypedSerDe(Type objectType) throws SerDeException { super(objectType); bos = new ByteStream.Output(); bis = new ByteStream.Input(); }
@Override protected void commonSetup() throws HiveException { super.commonSetup(); /* * Initialize Multi-Key members for this specialized class. */ keyVectorSerializeWrite = new VectorSerializeRow( new BinarySortableSerializeWrite(bigTableKeyColumnMap.length)); keyVectorSerializeWrite.init(bigTableKeyTypeInfos, bigTableKeyColumnMap); currentKeyOutput = new Output(); saveKeyOutput = new Output(); }
private Output serializeRow(Object[] row, VectorRandomRowSource source, SerializeWrite serializeWrite) throws HiveException, IOException { Output output = new Output(); serializeWrite.set(output); TypeInfo[] typeInfos = source.typeInfos(); for (int i = 0; i < typeInfos.length; i++) { VectorVerifyFast.serializeWrite(serializeWrite, typeInfos[i], row[i]); } return output; }
@Override protected void commonSetup() throws HiveException { super.commonSetup(); /* * Initialize Multi-Key members for this specialized class. */ keyVectorSerializeWrite = new VectorSerializeRow( new BinarySortableSerializeWrite(bigTableKeyColumnMap.length)); keyVectorSerializeWrite.init(bigTableKeyTypeInfos, bigTableKeyColumnMap); currentKeyOutput = new Output(); saveKeyOutput = new Output(); }
public VectorRowBytesContainer(String spillLocalDirs) { output = new Output(); readBuffer = new byte[INPUT_SIZE]; readNextBytes = new byte[MAX_READS][]; readNextOffsets = new int[MAX_READS]; readNextLengths = new int[MAX_READS]; isOpen = false; totalWriteLength = 0; totalReadLength = 0; this.spillLocalDirs = spillLocalDirs; }
public VectorKeySeriesSerializedImpl(T serializeWrite) { super(); this.serializeWrite = serializeWrite; output = new Output(); serializedKeyLengths = new int[VectorizedRowBatch.DEFAULT_SIZE]; }