IntervalClause { private FunctionResolver interval() { return define(BuiltinFunctionName.INTERVAL.getName(), impl(IntervalClause::interval, INTERVAL, INTEGER, STRING), impl(IntervalClause::interval, INTERVAL, LONG, STRING)); }  void register(BuiltinFunctionRepository repository);  }
@Test public void unsupported_unit() { FunctionExpression expr = dsl.interval(DSL.literal(1), DSL.literal("year_month")); assertThrows(ExpressionEvaluationException.class, () -> expr.valueOf(env), "interval unit year_month is not supported"); }
@Test public void to_string() { FunctionExpression expr = dsl.interval(DSL.literal(1), DSL.literal("day")); assertEquals("interval(1, \"day\")", expr.toString()); }