Package io.lenses.sql.udf
Class UdfException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- io.lenses.sql.udf.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 UdfExceptionargumentTypeNotSupported(java.lang.String functionName, int position, DataType dataType)Creates a UdfException indicating that an invalid data type was encountered.static UdfExceptionargumentTypesNotSupported(java.lang.String functionName, java.util.List<DataType> dataTypes)Creates a UdfException indicating that an invalid combination of data types was encountered.static UdfExceptioncontainerToPrimitiveConversion(DataType from, DataType to)Creates a UdfException indicating, that the conversion between a container type to a primitive type is not supported.static UdfExceptionconversionError(DataType from, DataType to, java.lang.Object value)Creates a UdfException indicating, that the conversion between two value types is supported but failed.static UdfExceptionconversionNotSupported(DataType from, DataType to)Creates a UdfException indicating, that the conversion between two value types is not supported.static UdfExceptionevaluationFailed(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 UdfExceptionfieldAccessError(java.util.List<Value> fields, int pos)Creates a UDFException indicating that access of a struct field has failed.
-
-
-
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.
-
-