FLOAT Data Type FLOAT

A single precision floating-point data type used in CREATE TABLE and ALTER TABLE statements.

In the column definition of a CREATE TABLE statement:

column_name FLOAT

Range: 1.40129846432481707e-45 .. 3.40282346638528860e+38, positive or negative

Precision: 6 to 9 significant digits, depending on usage. The number of significant digits does not depend on the position of the decimal point.

Representation: The values are stored in 4 bytes, using IEEE 754 Single Precision Binary Floating Point format.

Conversions: Impala automatically converts FLOAT to more precise DOUBLE values, but not the other way around. You can use CAST() to convert FLOAT values to TINYINT, SMALLINT, INT, BIGINT, STRING, TIMESTAMP, or BOOLEAN. You can use exponential notation in FLOAT literals or when casting from STRING, for example 1.0e6 to represent one million.

SELECT CAST('nan' AS FLOAT)=CAST('nan' AS FLOAT);

CREATE TABLE t1 (x FLOAT); SELECT CAST(1000.5 AS FLOAT);

, ,