public String toString() { return asChars(); }
public String toString() { return asChars(); }
@Override public byte[] asTextBytes() { return asChars().getBytes(TextDatum.DEFAULT_CHARSET); }
@Override public byte[] asTextBytes() { return asChars().getBytes(TextDatum.DEFAULT_CHARSET); }
@Override public String asChars() { TimeMeta tm = asTimeMeta(); return asChars(tm, TimeZone.getDefault(), true); }
@Override public String asChars() { TimeMeta tm = asTimeMeta(); return asChars(tm, TimeZone.getDefault(), true); }
public String toString(TimeZone timeZone, boolean includeTimeZone) { return asChars(asTimeMeta(), timeZone, includeTimeZone); }
public String toString(TimeZone timeZone, boolean includeTimeZone) { return asChars(asTimeMeta(), timeZone, includeTimeZone); }
private String getString(Tuple tuple, int index) throws SQLException { if (handleNull(tuple, index)) { return null; } switch(tuple.type(index)) { case BOOLEAN: return String.valueOf(tuple.getBool(index)); case TIMESTAMP: return TimestampDatum.asChars(tuple.getTimeDate(index), timezone, false); default : return tuple.asDatum(index).asChars(); } }
private String getString(Tuple tuple, int index) throws SQLException { if (handleNull(tuple, index)) { return null; } switch(tuple.type(index)) { case BOOLEAN: return String.valueOf(tuple.getBool(index)); case TIMESTAMP: return TimestampDatum.asChars(tuple.getTimeDate(index), timezone, false); default : return tuple.asDatum(index).asChars(); } }
break; case TIMESTAMP: bytes = ((TimestampDatum)datum).asChars(TajoConf.getCurrentTimeZone(), true).getBytes(); length = bytes.length; out.write(bytes);
case TIMESTAMP: bytes = TimestampDatum.asChars( tuple.getTimeDate(columnIndex), tableTimezone, false).getBytes(Bytes.UTF8_CHARSET);
case TIMESTAMP: bytes = TimestampDatum.asChars( tuple.getTimeDate(columnIndex), tableTimezone, false).getBytes(Bytes.UTF8_CHARSET);
@Test public void testCastWithNestedFunction() throws TajoException { QueryContext context = new QueryContext(getConf()); context.put(SessionVars.TIMEZONE, "GMT-6"); TimeZone tz = TimeZone.getTimeZone("GMT-6"); int unixtime = 1389071574; // (int) (System.currentTimeMillis() / 1000); TimestampDatum expected = DatumFactory.createTimestampDatumWithUnixTime(unixtime); testSimpleEval(context, String.format("select to_timestamp(CAST(split_part('%d.999', '.', 1) as INT8));", unixtime), new String[] {TimestampDatum.asChars(expected.asTimeMeta(), tz, false)}); }
case TIMESTAMP: return TimestampDatum.asChars(tuple.getTimeDate(columnIndex), tableTimezone, false); case BLOB: return Base64.encodeBase64String(tuple.getBytes(columnIndex));
json.put(fieldName, TimestampDatum.asChars(input.getTimeDate(fieldIndex), timezone, false)); break; case TIME:
json.put(fieldName, TimestampDatum.asChars(input.getTimeDate(fieldIndex), timezone, false)); break; case TIME:
String outTupleAsChars; if (outTuple.type(i) == Type.TIMESTAMP) { outTupleAsChars = TimestampDatum.asChars(outTuple.getTimeDate(i), timeZone, false); } else { outTupleAsChars = outTuple.asDatum(i).toString();