use of com.facebook.presto.sql.tree.AlterRoutineCharacteristics in project presto by prestodb.
the class TestSqlParser method testAlterFunction.
@Test
public void testAlterFunction() {
QualifiedName functionName = QualifiedName.of("testing", "default", "tan");
assertStatement("ALTER FUNCTION testing.default.tan\n" + "CALLED ON NULL INPUT", new AlterFunction(functionName, Optional.empty(), new AlterRoutineCharacteristics(Optional.of(CALLED_ON_NULL_INPUT))));
assertStatement("ALTER FUNCTION testing.default.tan(double)\n" + "RETURNS NULL ON NULL INPUT", new AlterFunction(functionName, Optional.of(ImmutableList.of("double")), new AlterRoutineCharacteristics(Optional.of(RETURNS_NULL_ON_NULL_INPUT))));
assertInvalidStatement("ALTER FUNCTION testing.default.tan", "No alter routine characteristics specified");
assertInvalidStatement("ALTER FUNCTION testing.default.tan\n" + "RETURNS NULL ON NULL INPUT\n" + "RETURNS NULL ON NULL INPUT", "Duplicate null-call clause: RETURNSNULLONNULLINPUT");
}
Aggregations