Interface UDFContext
- All Known Implementing Classes:
UDFContextImpl
public interface UDFContext
Provides context information for a particular user defined function.
Java UDFs can access implementations of this interface using the
udfContext field, scripted UDFs can get it using the udfContext
binding.-
Method Summary
Modifier and TypeMethodDescriptionnewArgTupleValue(int argNum) Creates a newTupleValueinstance for an argument.newArgTupleValue(String argName) Creates a newTupleValueinstance for an argument.newArgUDTValue(int argNum) Creates a newUDTValueinstance for an argument.newArgUDTValue(String argName) Creates a newUDTValueinstance for an argument.Creates a newTupleValueinstance for the return value.Creates a newUDTValueinstance for the return value.newTupleValue(String cqlDefinition) Creates a newTupleValueinstance for the CQL type definition.newUDTValue(String udtName) Creates a newUDTValueinstance by name in the same keyspace.
-
Method Details
-
newArgUDTValue
Creates a newUDTValueinstance for an argument.- Parameters:
argName- name of the argument as declared in theCREATE FUNCTIONstatement- Returns:
- a new
UDTValueinstance - Throws:
IllegalArgumentException- if no argument for the given name existsIllegalStateException- if the argument is not a UDT
-
newArgUDTValue
Creates a newUDTValueinstance for an argument.- Parameters:
argNum- zero-based index of the argument as declared in theCREATE FUNCTIONstatement- Returns:
- a new
UDTValueinstance - Throws:
ArrayIndexOutOfBoundsException- if no argument for the given index existsIllegalStateException- if the argument is not a UDT
-
newReturnUDTValue
UDTValue newReturnUDTValue()Creates a newUDTValueinstance for the return value.- Returns:
- a new
UDTValueinstance - Throws:
IllegalStateException- if the return type is not a UDT
-
newUDTValue
Creates a newUDTValueinstance by name in the same keyspace.- Parameters:
udtName- name of the user defined type in the same keyspace as the function- Returns:
- a new
UDTValueinstance - Throws:
IllegalArgumentException- if no UDT for the given name exists
-
newArgTupleValue
Creates a newTupleValueinstance for an argument.- Parameters:
argName- name of the argument as declared in theCREATE FUNCTIONstatement- Returns:
- a new
TupleValueinstance - Throws:
IllegalArgumentException- if no argument for the given name existsIllegalStateException- if the argument is not a tuple
-
newArgTupleValue
Creates a newTupleValueinstance for an argument.- Parameters:
argNum- zero-based index of the argument as declared in theCREATE FUNCTIONstatement- Returns:
- a new
TupleValueinstance - Throws:
ArrayIndexOutOfBoundsException- if no argument for the given index existsIllegalStateException- if the argument is not a tuple
-
newReturnTupleValue
TupleValue newReturnTupleValue()Creates a newTupleValueinstance for the return value.- Returns:
- a new
TupleValueinstance - Throws:
IllegalStateException- if the return type is not a tuple
-
newTupleValue
Creates a newTupleValueinstance for the CQL type definition.- Parameters:
cqlDefinition- CQL tuple type definition liketuple<int, text, bigint>- Returns:
- a new
TupleValueinstance - Throws:
IllegalStateException- if cqlDefinition type is not a tuple or an invalid type
-