Numeric Types
Singdata Lakehouse supports integer types (TINYINT, SMALLINT, INT, BIGINT) and floating-point / exact decimal types (FLOAT, DOUBLE, DECIMAL).
Type Comparison
Integer Types
| Type | Storage | Range | Use Case |
|---|---|---|---|
TINYINT | 1 byte | -128 ~ 127 | Status codes, enum values, small-range flags |
SMALLINT | 2 bytes | -32,768 ~ 32,767 | Year values, small-range counters |
INT | 4 bytes | -2,147,483,648 ~ 2,147,483,647 | General integer IDs, counters |
BIGINT | 8 bytes | -9.2×10¹⁸ ~ 9.2×10¹⁸ | Large-scale IDs, timestamps (milliseconds), cumulative totals |
A CAST that exceeds the range returns NULL (no error):
Floating-Point and Exact Decimal Types
| Type | Storage | Precision | Use Case |
|---|---|---|---|
FLOAT | 4 bytes | ~6-7 significant digits | ML feature values, vector elements, approximate real numbers |
DOUBLE | 8 bytes | ~15-17 significant digits | Scientific computing, statistical analysis |
DECIMAL(p,s) | Variable | Exact | Financial amounts, decimals requiring exact calculation |
FLOAT vs DOUBLE precision difference (measured):
Floating-point precision error example:
