Numeric Data Type Aliases
Redpanda SQL accepts aliases that you can use interchangeably with the primary data types. During processing, Redpanda SQL maps these aliases to their corresponding primary data types.
The following sections describe the numeric data type aliases:
integer alias
The integer alias is an alternative name for the int data type. For example, the following two queries are functionally the same:
CREATE TABLE ExampleTable (
id INTEGER
);
-- Functionally the same as the previous table
CREATE TABLE AnotherTable (
id INT,
);
|
Even though you specify the |
long alias
The long alias is often used to represent larger integer values. For example:
CREATE TABLE LargeValues (
value LONG
);
-- Functionally the same as the previous table
CREATE TABLE LargeValuesEquivalent (
value BIGINT
);
|
Even though you specify the |
float alias
The float alias corresponds to the real data type. For example:
CREATE TABLE FloatExample (
price FLOAT
);
-- Functionally the same as the previous table
CREATE TABLE FloatEquivalent (
price REAL
);
|
Even though you specify the |
double alias
The double alias defines double precision floating-point numbers. For example:
CREATE TABLE DoubleExample (
measurement DOUBLE
);
-- Functionally the same as the previous table
CREATE TABLE DoubleEquivalent (
measurement DOUBLE PRECISION
);
|
Even though you specify the |