For the complete documentation index, see llms.txt. This page is also available as Markdown.

TRIM

This page describes the TRIM function in Lenses SQL.

TRIM(expr)

Removes leading and trailing spaces from the input expression.

Available in:

Processors
SQL Studio

Sample code:

USE `kafka`;
SELECT 
    LPAD(product_name, 50, ' '), 
    TRIM(LPAD(product_name, 50, ' ')), 
    product_name 
FROM products-topic
LIMIT 1;

Output:

{
  "value": {
    "LPAD": "                                        Soft Shirt",
    "TRIM": "Soft Shirt",
    "product_name": "Soft Shirt"
  }
}

LPAD function was used to emulate a space this way, using the TRIM function.

To know more about LPAD.

Last updated

Was this helpful?