Data Type - Hierarchy

> Code - (Programming|Computer) Language > (Data) Type - (Datatype|Type of data)

1 - About

Hierarchy relationship in data type.

Advertising

3 - Type

3.1 - Hierarchy of type

The hierarchy of type defines how the types are implicitly converted. Implicit conversion is allowed for types from child to an ancestor. Example of Hierarchy for Hive:

Primitive Type > Number > DOUBLE > FLOAT > BIGINT > INT > SMALLINT > TINYINT
                                 > STRING
               > BOOLEAN

Note that the type hierarchy allows the implicit conversion of STRING to DOUBLE.

3.2 - Hierarchy of class

More generally, every type may be organised in a hierarchy using a inheritance design. Example in Java: Java - (Inheritance|Class Hierarchy) - (Subclass|Superclass) - (Extends, Super) - ("is a" relationship)