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 Details

    • newArgUDTValue

      UDTValue newArgUDTValue(String argName)
      Creates a new UDTValue instance for an argument.
      Parameters:
      argName - name of the argument as declared in the CREATE FUNCTION statement
      Returns:
      a new UDTValue instance
      Throws:
      IllegalArgumentException - if no argument for the given name exists
      IllegalStateException - if the argument is not a UDT
    • newArgUDTValue

      UDTValue newArgUDTValue(int argNum)
      Creates a new UDTValue instance for an argument.
      Parameters:
      argNum - zero-based index of the argument as declared in the CREATE FUNCTION statement
      Returns:
      a new UDTValue instance
      Throws:
      ArrayIndexOutOfBoundsException - if no argument for the given index exists
      IllegalStateException - if the argument is not a UDT
    • newReturnUDTValue

      UDTValue newReturnUDTValue()
      Creates a new UDTValue instance for the return value.
      Returns:
      a new UDTValue instance
      Throws:
      IllegalStateException - if the return type is not a UDT
    • newUDTValue

      UDTValue newUDTValue(String udtName)
      Creates a new UDTValue instance by name in the same keyspace.
      Parameters:
      udtName - name of the user defined type in the same keyspace as the function
      Returns:
      a new UDTValue instance
      Throws:
      IllegalArgumentException - if no UDT for the given name exists
    • newArgTupleValue

      TupleValue newArgTupleValue(String argName)
      Creates a new TupleValue instance for an argument.
      Parameters:
      argName - name of the argument as declared in the CREATE FUNCTION statement
      Returns:
      a new TupleValue instance
      Throws:
      IllegalArgumentException - if no argument for the given name exists
      IllegalStateException - if the argument is not a tuple
    • newArgTupleValue

      TupleValue newArgTupleValue(int argNum)
      Creates a new TupleValue instance for an argument.
      Parameters:
      argNum - zero-based index of the argument as declared in the CREATE FUNCTION statement
      Returns:
      a new TupleValue instance
      Throws:
      ArrayIndexOutOfBoundsException - if no argument for the given index exists
      IllegalStateException - if the argument is not a tuple
    • newReturnTupleValue

      TupleValue newReturnTupleValue()
      Creates a new TupleValue instance for the return value.
      Returns:
      a new TupleValue instance
      Throws:
      IllegalStateException - if the return type is not a tuple
    • newTupleValue

      TupleValue newTupleValue(String cqlDefinition)
      Creates a new TupleValue instance for the CQL type definition.
      Parameters:
      cqlDefinition - CQL tuple type definition like tuple<int, text, bigint>
      Returns:
      a new TupleValue instance
      Throws:
      IllegalStateException - if cqlDefinition type is not a tuple or an invalid type