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());
}
Aggregations