Skip to main content
VeloDB Cloud 26.x is based Doris 4.x (up to 4.0 supported). Versions on this page refer to Doris versions. See Version Mapping.

Numeric Type Literal

Use numeric Literals to specify fixed-point and floating-point numbers.

Integer Literal​

Integers are represented as a sequence of digits. They may have a sign. For example: +1, -2, 345.

Doris determines the type used to store integer literals based on the input value. The range mapping is shown in the table below:

Value RangeType
-2^7 to 2^7 - 1TINYINT
-2^15 to 2^15 - 1SMALLINT
-2^31 to 2^31 - 1INT
-2^63 to 2^63 - 1BIGINT
-2^127 to 2^127 - 1LARGEINT

Fixed and Floating Point Numeric Literals​

Fixed and floating point numeric literals can have an integer part, a fractional part, or both. They may have a sign. For example: 1, .2, 3.4, -5, -6.78, +9.10.

They can also be represented in scientific notation, including the significand and exponent. Either part or both can have a sign. For example: 1.2E3, 1.2E-3, -1.2E3, -1.2E-3.

Numbers represented in this way are preferentially parsed as fixed-point numbers. The range of supported fixed-point numbers is controlled by the variable enable_decimal256. When enable_decimal256 is TRUE, the maximum precision is 76. When enable_decimal256 is FALSE, the maximum precision is 38.

When the precision required by a number exceeds the maximum value representable by fixed-point numbers, it is parsed as a floating-point number, with the type DOUBLE.