Class UdfException

  • All Implemented Interfaces:
    java.io.Serializable

    public class UdfException
    extends java.lang.Exception
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      UdfException​(java.lang.String message)  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static UdfException argumentTypeNotSupported​(java.lang.String functionName, int position, DataType dataType)
      Creates a UdfException indicating that an invalid data type was encountered.
      static UdfException argumentTypesNotSupported​(java.lang.String functionName, java.util.List<DataType> dataTypes)
      Creates a UdfException indicating that an invalid combination of data types was encountered.
      static UdfException containerToPrimitiveConversion​(DataType from, DataType to)
      Creates a UdfException indicating, that the conversion between a container type to a primitive type is not supported.
      static UdfException conversionError​(DataType from, DataType to, java.lang.Object value)
      Creates a UdfException indicating, that the conversion between two value types is supported but failed.
      static UdfException conversionNotSupported​(DataType from, DataType to)
      Creates a UdfException indicating, that the conversion between two value types is not supported.
      static UdfException evaluationFailed​(java.lang.String functionName, java.util.List<Value> args, java.lang.String reason)
      Creates a UdfException indicating that the evaluation of the UDF for the given arguments failed.
      static UdfException fieldAccessError​(java.util.List<Value> fields, int pos)
      Creates a UDFException indicating that access of a struct field has failed.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • UdfException

        public UdfException​(java.lang.String message)
    • Method Detail

      • conversionNotSupported

        public static UdfException conversionNotSupported​(DataType from,
                                                          DataType to)
        Creates a UdfException indicating, that the conversion between two value types is not supported.
        Parameters:
        from - The original value type.
        to - The target value type.
        Returns:
        A UdfException with a description of the error.
      • containerToPrimitiveConversion

        public static UdfException containerToPrimitiveConversion​(DataType from,
                                                                  DataType to)
        Creates a UdfException indicating, that the conversion between a container type to a primitive type is not supported.
        Parameters:
        from - The container value type.
        to - The target primitive value type.
        Returns:
        A UdfException with a description of the error.
      • conversionError

        public static UdfException conversionError​(DataType from,
                                                   DataType to,
                                                   java.lang.Object value)
        Creates a UdfException indicating, that the conversion between two value types is supported but failed.
        Parameters:
        from - The original value type.
        to - The target value type.
        value - The underlying value.
        Returns:
        A UdfException with a description of the error.
      • argumentTypeNotSupported

        public static UdfException argumentTypeNotSupported​(java.lang.String functionName,
                                                            int position,
                                                            DataType dataType)
        Creates a UdfException indicating that an invalid data type was encountered.
        Parameters:
        functionName - The name of the UDF.
        position - The position of the invalid data type.
        dataType - The invalid data type.
        Returns:
        A UdfException with a description of the error.
      • argumentTypesNotSupported

        public static UdfException argumentTypesNotSupported​(java.lang.String functionName,
                                                             java.util.List<DataType> dataTypes)
        Creates a UdfException indicating that an invalid combination of data types was encountered.
        Parameters:
        functionName - The name of the UDF.
        dataTypes - List of input data types.
        Returns:
        A UdfException with a description of the error.
      • fieldAccessError

        public static UdfException fieldAccessError​(java.util.List<Value> fields,
                                                    int pos)
        Creates a UDFException indicating that access of a struct field has failed.
        Parameters:
        fields - The fields of the struct value.
        pos - The position of the accessed field.
        Returns:
        A UdfException with a description of the error.
      • evaluationFailed

        public static UdfException evaluationFailed​(java.lang.String functionName,
                                                    java.util.List<Value> args,
                                                    java.lang.String reason)
        Creates a UdfException indicating that the evaluation of the UDF for the given arguments failed.
        Parameters:
        functionName - The name of the UDF.
        args - List of args passed to the evaluation method.
        reason - The reason for the failure.
        Returns:
        A UdfException with a description of the error.