Data type mapping for data movement

When the tables are transferred from Db2® Warehouse to Hadoop, some of the data types are changed. The following table shows the data conversion pattern.

Table 1. Data type mapping for data movement
Data type on Db2 Data type on Hive Data type on BigSQL
Boolean Boolean Boolean
Real, Double Float, Double Float, Double
Smallint, Integer, Bigint Smallint, Integer, Bigint Smallint, Integer, Bigint
Decimal, Numeric, Decfloat

DECIMAL for Hive 0.13 and above;

STRING for older Hive versions

Decimal
Char, Varchar, Graphic, Vargraphic

STRING - default, see note below;

VARCHAR when: fq.hive.usevarchar = true in the import configuration XML file, and Hive version is 0.12 and above.

Varchar
Date

STRING - default

DATE when fq.hive.usedate = true in the import configuration XML, and Hive version is 0.12 and above.

Varchar(30)
Timestamp TIMESTAMP Timestamp
Time STRING Varchar(30)
Note:
  1. For data types that are mapped to STRING, such as date, time, and interval, the Db2 null value is stored as an empty string on Hadoop.
  2. Because of the limitations described in Limitations on VARCHAR data types, on Hive, the VARCHAR data types are by default changed to STRING.