Search in sources :

Example 1 with CqlParser

use of org.apache.cassandra.cql3.CqlParser in project cassandra by apache.

the class UFAuthTest method functionResource.

private FunctionResource functionResource(String functionName) {
    // Note that this is somewhat brittle as it assumes that function names are
    // truly unique. As such, it will break in the face of overloading.
    // It is here to avoid having to duplicate the functionality of CqlParser
    // for transforming cql types into AbstractTypes
    FunctionName fn = parseFunctionName(functionName);
    Collection<Function> functions = Schema.instance.getFunctions(fn);
    assertEquals(String.format("Expected a single function definition for %s, but found %s", functionName, functions.size()), 1, functions.size());
    return FunctionResource.function(fn.keyspace, fn.name, functions.iterator().next().argTypes());
}
Also used : FunctionName(org.apache.cassandra.cql3.functions.FunctionName) Function(org.apache.cassandra.cql3.functions.Function)

Aggregations

Function (org.apache.cassandra.cql3.functions.Function)1 FunctionName (org.apache.cassandra.cql3.functions.FunctionName)1