Data Type - Coercion (ie Type Conversion)

1 - About

Type conversion is called generally “coercion.”

Coercion is the fact to change:

3 - Function

The function name to coerce can be:

  • cast
  • coerce

4 - Form

Implicit vs Explicit

4.1 - Implicit (silent)

Silent coercions can make debugging a broken program particularly frustrating, since they cover up errors and make them harder to diagnose.

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
Note that the type hierarchy allows the implicit conversion of STRING to DOUBLE.

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap