Data Type
Overview
Data type is a basic attribute of data and used to distinguish different types of data. Different data types occupy different storage space and support different operations. Data is stored in data tables in the database. Each column of a data table defines the data type. During storage, data must be stored according to data types.
Similar to the open source community, StreamSQL of the Huawei big data platform supports both native data types and complex data types.
Primitive Data Types
Table 1 lists native data types supported by Stream SQL.
| Data Type | Description | Storage Space | Value Range |
|---|---|---|---|
| VARCHAR | Character with a variable length | - | - |
| BOOLEAN | Boolean | - | TRUE/FALSE |
| TINYINT | Signed integer | 1 byte | -128-127 |
| SMALLINT | Signed integer | 2 bytes | -32768-32767 |
| INT | Signed integer | 4 bytes | –2147483648 to 2147483647 |
| INTEGER | Signed integer | 4 bytes | –2147483648 to 2147483647 |
| BIGINT | Signed integer | 8 bytes | –9223372036854775808 to 9223372036854775807 |
| REAL | Single-precision floating point | 4 bytes | - |
| FLOAT | Single-precision floating point | 4 bytes | - |
| DOUBLE | Double-precision floating-point | 8 bytes | - |
| DECIMAL | Data type of valid fixed places and decimal places | - | - |
| DATE | Date type in the format of yyyy-MM-dd, for example, 2014-05-29 | - | DATE does not contain time information. Its value ranges from 0000-01-01 to 9999-12-31. |
| TIME | Time type in the format of HH:MM:SS For example, 20:17:40 | - | - |
| TIMESTAMP(3) | Timestamp of date and time For example, 1969-07-20 20:17:40 | - | - |
| INTERVAL timeUnit [TO timeUnit] | Time interval For example, INTERVAL '1:5' YEAR TO MONTH, INTERVAL '45' DAY | - | - |
Complex Data Types
Table 2 lists complex data types supported by Stream SQL.
Last Article: Custom Sink Stream
Next Article: Built-In Functions
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.