@Override public BytesWritable getPrimitiveWritableObject(Object o) { return null == o ? null : ((LazyBinary) o).getWritableObject(); } }
@Override public byte[] getPrimitiveJavaObject(Object o) { if (null == o) { return null; } return LazyUtils.createByteArray(((LazyBinary) o).getWritableObject()); }
public LazyBinary(LazyBinary other){ super(other); BytesWritable incoming = other.getWritableObject(); byte[] bytes = new byte[incoming.getLength()]; System.arraycopy(incoming.getBytes(), 0, bytes, 0, incoming.getLength()); data = new BytesWritable(bytes); }
throw new RuntimeException("Expected LazyBinary"); BytesWritable bytesWritable = ((LazyBinary) primitiveObject).getWritableObject(); byte[] value = Arrays.copyOfRange(bytesWritable.getBytes(), 0, bytesWritable.getLength()); BytesWritable bytesWritableExpected = (BytesWritable) expectedObject;
@Override public BytesWritable getPrimitiveWritableObject(Object o) { return null == o ? null : ((LazyBinary) o).getWritableObject(); } }
@Override public BytesWritable getPrimitiveWritableObject(Object o) { return null == o ? null : ((LazyBinary) o).getWritableObject(); } }
@Override public BytesWritable getPrimitiveWritableObject(Object o) { return null == o ? null : ((LazyBinary) o).getWritableObject(); } }
@Override public BytesWritable getPrimitiveWritableObject(Object o) { return null == o ? null : ((LazyBinary) o).getWritableObject(); } }
@Override public byte[] getPrimitiveJavaObject(Object o) { if (null == o) { return null; } return LazyUtils.createByteArray(((LazyBinary) o).getWritableObject()); }
@Override public byte[] getPrimitiveJavaObject(Object o) { if (null == o) { return null; } return LazyUtils.createByteArray(((LazyBinary) o).getWritableObject()); }
@Override public byte[] getPrimitiveJavaObject(Object o) { if (null == o) { return null; } return LazyUtils.createByteArray(((LazyBinary) o).getWritableObject()); }
@Override public byte[] getPrimitiveJavaObject(Object o) { if (null == o) { return null; } return LazyUtils.createByteArray(((LazyBinary) o).getWritableObject()); }
public LazyBinary(LazyBinary other){ super(other); BytesWritable incoming = other.getWritableObject(); byte[] bytes = new byte[incoming.getLength()]; System.arraycopy(incoming.getBytes(), 0, bytes, 0, incoming.getLength()); data = new BytesWritable(bytes); }
public LazyBinary(LazyBinary other){ super(other); BytesWritable incoming = other.getWritableObject(); byte[] bytes = new byte[incoming.getLength()]; System.arraycopy(incoming.getBytes(), 0, bytes, 0, incoming.getLength()); data = new BytesWritable(bytes); }
public LazyBinary(LazyBinary other){ super(other); BytesWritable incoming = other.getWritableObject(); byte[] bytes = new byte[incoming.getLength()]; System.arraycopy(incoming.getBytes(), 0, bytes, 0, incoming.getLength()); data = new BytesWritable(bytes); }
public LazyBinary(LazyBinary other){ super(other); BytesWritable incoming = other.getWritableObject(); byte[] bytes = new byte[incoming.getLength()]; System.arraycopy(incoming.getBytes(), 0, bytes, 0, incoming.getLength()); data = new BytesWritable(bytes); }
throw new RuntimeException("Expected LazyBinary"); BytesWritable bytesWritable = ((LazyBinary) primitiveObject).getWritableObject(); byte[] value = Arrays.copyOfRange(bytesWritable.getBytes(), 0, bytesWritable.getLength()); BytesWritable bytesWritableExpected = (BytesWritable) expectedObject;
@Override public void iterate(AggregationBuffer aggregationBuffer, Object[] parameters) throws HiveException { if (parameters[0] == null) { return; } int param = -1; if (parameters.length >= 2) { String type = PrimitiveObjectInspectorUtils.getString(parameters[1], typeOI); ce = CardinalityEstimator.valueOf(type.toUpperCase()); } if (parameters.length == 3) { param = PrimitiveObjectInspectorUtils.getInt(parameters[2], paramOI); } CardinalityEstimatorBuffer ceb = (CardinalityEstimatorBuffer) aggregationBuffer; Object obj = parameters[0]; if (inputPrimitiveOI != null) { // in this case, we process the object directly if (ceb.cardinalityEstimator == null) { initEstimator(param, ceb); } ceb.cardinalityEstimator.offer(obj); } else if (inputStructOI != null) { // in this case we merge estimators LazyString type = (LazyString) inputStructOI.getStructFieldData(obj, inputStructOI.getStructFieldRef(ESTIMATOR_TYPE)); LazyBinary lb = (LazyBinary) inputStructOI.getStructFieldData(obj, inputStructOI.getStructFieldRef(BINARY)); ICardinality that = buildEstimator(lb.getWritableObject(), type.toString()); mergeEstimators(that, ceb); } }