Syntax
Parameters
| Parameter | Description | Supported input types |
|---|---|---|
<value> | The value to truncate. | INTEGER, BIGINT, TEXT, BYTEA |
<width> | The truncation width. Must be a positive constant. | BIGINT |
Return type
Returns the same type as the input<value>:
INTEGERforINTEGERinputBIGINTforBIGINTinputTEXTforTEXTinputBYTEAforBYTEAinput
Remarks
TheICEBERG_TRUNCATE function can be used in the PARTITION BY clause of CREATE ICEBERG TABLE commands.
INTEGER, BIGINT): Returns the largest multiple of width that is less than or equal to the value. For negative values, this rounds toward negative infinity.
For strings (TEXT): Returns the first width Unicode code points of the string. If the string is shorter than width, returns the original string unchanged.
For binary (BYTEA): Returns the first width bytes of the binary data. If the data is shorter than width, returns the original data unchanged.
The <width> parameter must be a positive constant value. Using zero, negative values, or non-constant expressions results in an error.
Example
| truncated_partition |
|---|
| 12300 |