Interface UDFContext
-
- All Known Implementing Classes:
UDFContextImpl
public interface UDFContextProvides context information for a particular user defined function. Java UDFs can access implementations of this interface using theudfContextfield, scripted UDFs can get it using theudfContextbinding.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TupleValuenewArgTupleValue(int argNum)Creates a newTupleValueinstance for an argument.TupleValuenewArgTupleValue(java.lang.String argName)Creates a newTupleValueinstance for an argument.UDTValuenewArgUDTValue(int argNum)Creates a newUDTValueinstance for an argument.UDTValuenewArgUDTValue(java.lang.String argName)Creates a newUDTValueinstance for an argument.TupleValuenewReturnTupleValue()Creates a newTupleValueinstance for the return value.UDTValuenewReturnUDTValue()Creates a newUDTValueinstance for the return value.TupleValuenewTupleValue(java.lang.String cqlDefinition)Creates a newTupleValueinstance for the CQL type definition.UDTValuenewUDTValue(java.lang.String udtName)Creates a newUDTValueinstance by name in the same keyspace.
-
-
-
Method Detail
-
newArgUDTValue
UDTValue newArgUDTValue(java.lang.String argName)
Creates a newUDTValueinstance for an argument.- Parameters:
argName- name of the argument as declared in theCREATE FUNCTIONstatement- Returns:
- a new
UDTValueinstance - Throws:
java.lang.IllegalArgumentException- if no argument for the given name existsjava.lang.IllegalStateException- if the argument is not a UDT
-
newArgUDTValue
UDTValue newArgUDTValue(int argNum)
Creates a newUDTValueinstance for an argument.- Parameters:
argNum- zero-based index of the argument as declared in theCREATE FUNCTIONstatement- Returns:
- a new
UDTValueinstance - Throws:
java.lang.ArrayIndexOutOfBoundsException- if no argument for the given index existsjava.lang.IllegalStateException- if the argument is not a UDT
-
newReturnUDTValue
UDTValue newReturnUDTValue()
Creates a newUDTValueinstance for the return value.- Returns:
- a new
UDTValueinstance - Throws:
java.lang.IllegalStateException- if the return type is not a UDT
-
newUDTValue
UDTValue newUDTValue(java.lang.String udtName)
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:
java.lang.IllegalArgumentException- if no UDT for the given name exists
-
newArgTupleValue
TupleValue newArgTupleValue(java.lang.String argName)
Creates a newTupleValueinstance for an argument.- Parameters:
argName- name of the argument as declared in theCREATE FUNCTIONstatement- Returns:
- a new
TupleValueinstance - Throws:
java.lang.IllegalArgumentException- if no argument for the given name existsjava.lang.IllegalStateException- if the argument is not a tuple
-
newArgTupleValue
TupleValue newArgTupleValue(int argNum)
Creates a newTupleValueinstance for an argument.- Parameters:
argNum- zero-based index of the argument as declared in theCREATE FUNCTIONstatement- Returns:
- a new
TupleValueinstance - Throws:
java.lang.ArrayIndexOutOfBoundsException- if no argument for the given index existsjava.lang.IllegalStateException- if the argument is not a tuple
-
newReturnTupleValue
TupleValue newReturnTupleValue()
Creates a newTupleValueinstance for the return value.- Returns:
- a new
TupleValueinstance - Throws:
java.lang.IllegalStateException- if the return type is not a tuple
-
newTupleValue
TupleValue newTupleValue(java.lang.String cqlDefinition)
Creates a newTupleValueinstance for the CQL type definition.- Parameters:
cqlDefinition- CQL tuple type definition liketuple<int, text, bigint>- Returns:
- a new
TupleValueinstance - Throws:
java.lang.IllegalStateException- if cqlDefinition type is not a tuple or an invalid type
-
-