Package org.apache.tajo.datum

Examples of org.apache.tajo.datum.TimestampDatum


  public Datum eval(Tuple params) {
    if(params.isNull(0) || params.isNull(1)) {
      return NullDatum.get();
    }

    TimestampDatum valueDatum = (TimestampDatum) params.get(0);
    Datum pattern = params.get(1);

    if (formatter == null || !constantFormat) {
      formatter = DateTimeFormat.forPattern(pattern.asChars());
    }
    return DatumFactory.createText(valueDatum.toChars(formatter));
  }
View Full Code Here


  }

  @Test
  public void testCastWithNestedFunction() throws IOException {
    int timestamp = (int) (System.currentTimeMillis() / 1000);
    TimestampDatum expected = new TimestampDatum(timestamp);
    testSimpleEval(String.format("select to_timestamp(CAST(split_part('%d.999', '.', 1) as INT8));", timestamp),
        new String[] {expected.asChars()});
  }
View Full Code Here

TOP

Related Classes of org.apache.tajo.datum.TimestampDatum

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.