class StringToTimestamp implements Kudf {

  @Override
  public Object evaluate(final Object... args) {
    if (args.length != 2) {
      throw new KsqlFunctionException("StringToTimestamp udf should have two input argument:"
                                      + " date value and format.");
    }
    try {
      ensureInitialized(args);
      return timestampParser.parse(args[0].toString());
    } catch (final Exception e) {
      throw new KsqlFunctionException("Exception running StringToTimestamp(" + args[0] + ", "
                                      + args[1] + ") : " + e.getMessage(), e);
    }
  }

}