protected TimestampWritableV2 handleTimestampResult(Timestamp result) { if (result == null) { return null; } timestampResult.set(result); return timestampResult; }
protected TimestampWritableV2 handleTimestampResult(Timestamp result) { if (result == null) { return null; } timestampResult.set(result); return timestampResult; }
public Object set(Object o, TimestampWritableV2 t) { if (t == null) { return null; } ((TimestampWritableV2) o).set(t); return o; }
public Object set(Object o, Timestamp t) { if (t == null) { return null; } ((TimestampWritableV2) o).set(t); return o; }
public Object set(Object o, byte[] bytes, int offset) { ((TimestampWritableV2) o).set(bytes, offset); return o; }
public TimestampWritableV2(byte[] bytes, int offset) { set(bytes, offset); }
public TimestampWritableV2(Timestamp t) { set(t); }
@Deprecated public Object set(Object o, java.sql.Timestamp t) { if (t == null) { return null; } ((TimestampWritableV2) o).set(Timestamp.ofEpochMilli(t.getTime(), t.getNanos())); return o; }
public static TimestampWritableV2 timestampColumnVectorWritable( TimestampColumnVector timestampColVector, int elementNum, TimestampWritableV2 timestampWritable) { java.sql.Timestamp ts = timestampColVector.asScratchTimestamp(elementNum); if (ts == null) { timestampWritable.set((Timestamp) null); return timestampWritable; } Timestamp newTS = Timestamp.ofEpochMilli(ts.getTime(), ts.getNanos()); timestampWritable.set(newTS); return timestampWritable; }
/** * Initializes LazyBinaryTimestamp object * @param bytes * @param start * @param length * If length is 4, no decimal bytes follow, otherwise read following bytes * as VInt and reverse its value */ @Override public void init(ByteArrayRef bytes, int start, int length) { data.set(bytes.getData(), start); } }
@Override public void writeTimestamp(Timestamp vt) throws IOException { beginElement(); tempTimestampWritable.set(vt); BinarySortableSerDe.serializeTimestampWritable(output, tempTimestampWritable, columnSortOrderIsDesc[index]); }
public TimestampWritableV2 evaluate(TimestampWritableV2 t) { if (t == null) { return null; } final long originalTimestamp = t.getTimestamp().toEpochMilli(); final long newTimestamp = granularity.truncate(originalTimestamp); resultTS.set(Timestamp.ofEpochMilli(newTimestamp)); return resultTS; }
@Override public void writeTimestamp(Timestamp v) throws IOException { beginPrimitive(); if (timestampWritable == null) { timestampWritable = new TimestampWritableV2(); } timestampWritable.set(v); LazyTimestamp.writeUTF8(output, timestampWritable); finishPrimitive(); }
@Override public void writeTimestamp(Timestamp v) throws IOException { beginElement(); if (timestampWritable == null) { timestampWritable = new TimestampWritableV2(); } timestampWritable.set(v); timestampWritable.writeToByteStream(output); finishElement(); }
data.set(t);
/** * Evaluate the GenericUDF with the arguments. * * @param arguments timestamp and interval. * * @return The truncated timestamp to the beginning of tumbled window interval. */ @Override public Object evaluate(DeferredObject[] arguments) throws HiveException { if (arguments[0] == null) { return null; } Timestamp ts = PrimitiveObjectInspectorUtils.getTimestamp(arguments[0].get(), timestampOI); HiveIntervalDayTime idt = PrimitiveObjectInspectorUtils.getHiveIntervalDayTime(arguments[1].get(), intervalOI); Timestamp origin = originTsOI == null ? Timestamp.ofEpochMilli(0) : PrimitiveObjectInspectorUtils.getTimestamp(arguments[2].get(), originTsOI); timestampResult.set(Timestamp.ofEpochMilli(truncate(ts, idt, origin))); return timestampResult; }
return returnObj; case TIMESTAMP: ((TimestampWritableV2)returnObj).set((Timestamp)result); return returnObj; case BINARY:
((LazyTimestamp) lz).getWritableObject().set( Timestamp.ofEpochMilli(timestamp)); } else {
} else { TimestampWritableV2 r = reuse == null ? new TimestampWritableV2() : (TimestampWritableV2) reuse; r.set(ts); return r;