Data type mapping for data movement
When the tables are transferred from NPS® to Hadoop, some of the data types are changed. The following table shows the data conversion pattern.
| Data type on NPS | Data type on Hive | Data type on BigSQL |
|---|---|---|
| Boolean | Boolean | Boolean |
| Real, Double | FLOAT, DOUBLE | FLOAT, DOUBLE |
| Byteint, Smallint, Integer, Bigint | TINYINT, SMALLINT, INT, BIGINT, BIGINT | TINYINT, SMALLINT, INT, BIGINT, BIGINT |
| Numeric |
DECIMAL for Hive 0.13 and above; STRING for older Hive versions |
DECIMAL |
| Char, Varchar, Nchar, Nvarchar |
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 nz.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) |
| Interval | STRING | STRING |
Note:
- For data types that are mapped to STRING, such as date, time, and interval, the NPS null value is stored as an empty string on Hadoop.
- Because of the limitations described in Limitations on VARCHAR data types, on Hive, the VARCHAR data types are by default changed to STRING.