Package io.delta.kernel.types
Class DataType
Object
io.delta.kernel.types.DataType
- Direct Known Subclasses:
ArrayType,BasePrimitiveType,DecimalType,GeographyType,GeometryType,MapType,StructType
Base class for all data types.
- Since:
- 3.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanbooleanequivalent(DataType dataType) Are the data types same? The metadata, collations or column names could be different.abstract inthashCode()abstract booleanisNested()Returns true iff this data is a nested data type (it logically parameterized by other types).static booleanReturns true if the type value can be interpreted as raw bytes.booleanisWriteCompatible(DataType dataType) Checks whether the givendataTypeis compatible with this type when writing data.abstract StringtoString()
-
Constructor Details
-
DataType
public DataType()
-
-
Method Details
-
isTypeValueBinaryLike
Returns true if the type value can be interpreted as raw bytes. -
equivalent
Are the data types same? The metadata, collations or column names could be different.Should be used for schema comparisons during schema evolution.
- Parameters:
dataType-- Returns:
-
isWriteCompatible
Checks whether the givendataTypeis compatible with this type when writing data. Collation differences are ignored.This method is intended to be used during the write path to validate that an input type matches the expected schema before data is written.
It should not be used in other cases, such as the read path.
- Parameters:
dataType- the input data type being written- Returns:
trueif the input type is compatible with this type.
-
isNested
public abstract boolean isNested()Returns true iff this data is a nested data type (it logically parameterized by other types).For example StructType, ArrayType, MapType are nested data types.
-
hashCode
public abstract int hashCode() -
equals
-
toString
-