Class UDHelper


  • public final class UDHelper
    extends java.lang.Object
    Helper class for User Defined Functions, Types and Aggregates.
    • Constructor Detail

      • UDHelper

        public UDHelper()
    • Method Detail

      • codecFor

        public static TypeCodec<java.lang.Object> codecFor​(DataType dataType)
      • typeTokens

        public static com.google.common.reflect.TypeToken<?>[] typeTokens​(TypeCodec<java.lang.Object>[] dataTypes,
                                                                          boolean calledOnNullInput)
        Construct an array containing the Java classes for the given DataTypes.
        Parameters:
        dataTypes - array with UDF argument types
        calledOnNullInput - whether to allow null as an argument value
        Returns:
        array of same size with UDF arguments
      • driverTypes

        public static DataType[] driverTypes​(java.util.List<AbstractType<?>> abstractTypes)
        Construct an array containing the DataTypes for the C* internal types.
        Parameters:
        abstractTypes - list with UDF argument types
        Returns:
        array with argument types as DataType
      • driverTypeFromAbstractType

        public static DataType driverTypeFromAbstractType​(java.lang.String abstractTypeDef)
      • deserialize

        public static java.lang.Object deserialize​(TypeCodec<?> codec,
                                                   ProtocolVersion protocolVersion,
                                                   java.nio.ByteBuffer value)
      • serialize

        public static java.nio.ByteBuffer serialize​(TypeCodec<?> codec,
                                                    ProtocolVersion protocolVersion,
                                                    java.lang.Object value)
      • asJavaClass

        public static java.lang.Class<?> asJavaClass​(TypeCodec<?> codec)
      • isNullOrEmpty

        public static boolean isNullOrEmpty​(AbstractType<?> type,
                                            java.nio.ByteBuffer bb)