Skip to main content
Truncates a value to a specified width, according to the Iceberg partition transforms specification.

Syntax

Parameters

Return type

Returns the same type as the input <value>:
  • INTEGER for INTEGER input
  • BIGINT for BIGINT input
  • TEXT for TEXT input
  • BYTEA for BYTEA input

Remarks

The ICEBERG_TRUNCATE function can be used in the PARTITION BY clause of CREATE ICEBERG TABLE commands.
The truncation behavior depends on the input type: For integers (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

Rows: 1Execution time: 4.81ms