@Test public void applyYear() { ExpressionResult actual = testSubject.apply(expressionContext, mapValue("value", numericValue(1511442724079L), "format", stringValue("yyyy"))); assertEquals("2017", actual.getValue()); }
@Override public ExpressionResult apply(ExpressionContext context, ExpressionResult input) { ExpressionResult value = valueExpression.apply(context, input); return value.isNonNull() ? new StringExpressionResult(format(context, input, value.getNumericValue())) : NullExpressionResult.INSTANCE ; }
FormatDateExpression implements Expression, PipeExpression { @Override public ExpressionResult apply(ExpressionContext context, ExpressionResult input) { ExpressionResult value = valueExpression.apply(context, input); return value.isNonNull() ? new StringExpressionResult(format(context, input, value.getNumericValue())) : NullExpressionResult.INSTANCE ; } }
FormatDateExpression implements Expression, PipeExpression { @Override public ExpressionResult apply(ExpressionContext context, ExpressionResult input) { ExpressionResult value = valueExpression.apply(context, input); return value.isNonNull() ? new StringExpressionResult(format(context, input, value.getNumericValue())) : NullExpressionResult.INSTANCE ; } FormatDateExpression(String alias, Expression... parameters); }
FormatDateExpression implements Expression, PipeExpression { @Override public ExpressionResult apply(ExpressionContext context, ExpressionResult input) { ExpressionResult value = valueExpression.apply(context, input); return value.isNonNull() ? new StringExpressionResult(format(context, input, value.getNumericValue())) : NullExpressionResult.INSTANCE ; } FormatDateExpression(String alias, Expression... parameters); @Override ExpressionResult apply(ExpressionContext context, ExpressionResult input); @Override String alias(); @Override boolean process(ExpressionContext context, QueryResult result, Pipeline next); @Override List<String> getColumnNames(List<String> inputColumns); }
FormatDateExpression implements Expression, PipeExpression { @Override public ExpressionResult apply(ExpressionContext context, ExpressionResult input) { ExpressionResult value = valueExpression.apply(context, input); return value.isNonNull() ? new StringExpressionResult(format(context, input, value.getNumericValue())) : NullExpressionResult.INSTANCE ; } FormatDateExpression(String alias, Expression... parameters); @Override ExpressionResult apply(ExpressionContext context, ExpressionResult input); @Override String alias(); @Override boolean process(ExpressionContext context, QueryResult result, Pipeline next); @Override List<String> getColumnNames(List<String> inputColumns);  }