Search in sources :

Example 11 with Parameter

use of com.facebook.presto.spi.function.Parameter in project presto by prestodb.

the class TestMySqlFunctionNamespaceManager method testLongParameterTypeList.

public void testLongParameterTypeList() {
    List<Parameter> parameters = ImmutableList.of(new Parameter("x", createLargeRowType(4285)));
    createFunction(createFunctionTangent(parameters), false);
}
Also used : Parameter(com.facebook.presto.spi.function.Parameter)

Example 12 with Parameter

use of com.facebook.presto.spi.function.Parameter in project presto by prestodb.

the class TestMySqlFunctionNamespaceManager method testParameterNameTooLong.

@Test(expectedExceptions = PrestoException.class, expectedExceptionsMessageRegExp = "Parameter name exceeds max length of 100.*")
public void testParameterNameTooLong() {
    List<Parameter> parameters = ImmutableList.of(new Parameter(dummyString(101), parseTypeSignature(DOUBLE)));
    createFunction(createFunctionTangent(parameters), false);
}
Also used : Parameter(com.facebook.presto.spi.function.Parameter) Test(org.testng.annotations.Test)

Example 13 with Parameter

use of com.facebook.presto.spi.function.Parameter in project presto by prestodb.

the class TestMySqlFunctionNamespaceManager method testParameterTypeListTooLong.

@Test(expectedExceptions = PrestoException.class, expectedExceptionsMessageRegExp = "Parameter type list exceeds max length of 30000.*")
public void testParameterTypeListTooLong() {
    List<Parameter> parameters = ImmutableList.of(new Parameter("x", createLargeRowType(4286)));
    createFunction(createFunctionTangent(parameters), false);
}
Also used : Parameter(com.facebook.presto.spi.function.Parameter) Test(org.testng.annotations.Test)

Example 14 with Parameter

use of com.facebook.presto.spi.function.Parameter in project presto by prestodb.

the class TestMySqlFunctionNamespaceManager method testLongParameterName.

public void testLongParameterName() {
    List<Parameter> parameters = ImmutableList.of(new Parameter(dummyString(100), parseTypeSignature(DOUBLE)));
    createFunction(createFunctionTangent(parameters), false);
}
Also used : Parameter(com.facebook.presto.spi.function.Parameter)

Aggregations

Parameter (com.facebook.presto.spi.function.Parameter)14 SqlInvokedFunction (com.facebook.presto.spi.function.SqlInvokedFunction)8 Test (org.testng.annotations.Test)5 TypeSignature (com.facebook.presto.common.type.TypeSignature)4 PrestoException (com.facebook.presto.spi.PrestoException)4 QualifiedObjectName (com.facebook.presto.common.QualifiedObjectName)3 TypeSignature.parseTypeSignature (com.facebook.presto.common.type.TypeSignature.parseTypeSignature)3 RoutineCharacteristics (com.facebook.presto.spi.function.RoutineCharacteristics)3 SqlFunctionId (com.facebook.presto.spi.function.SqlFunctionId)3 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)3 List (java.util.List)3 TypeSignatureParameter (com.facebook.presto.common.type.TypeSignatureParameter)2 FunctionVersion.notVersioned (com.facebook.presto.spi.function.FunctionVersion.notVersioned)2 String.format (java.lang.String.format)2 Optional (java.util.Optional)2 Session (com.facebook.presto.Session)1 OperatorType (com.facebook.presto.common.function.OperatorType)1 OperatorType.tryGetOperatorType (com.facebook.presto.common.function.OperatorType.tryGetOperatorType)1 Type (com.facebook.presto.common.type.Type)1 TypeParameter (com.facebook.presto.common.type.TypeParameter)1