TRUNCATE

This page describes the TRUNCATE function in Lenses SQL.

TRUNCATE(strExpr, nExpr)

Truncates a string so that it has at most N characters.

Available in:

ProcessorsSQL Studio

Sample code:

USE `kafka`;
SELECT 
    `TRUNCATE`(first_name, 2), 
    first_name 
FROM users-topic
LIMIT 1;

Output:

{
  "value": {
    "TRUNCATE": "Jo",
    "first_name": "Jose"
  }
}

Last updated

Logo

2024 © Lenses.io Ltd. Apache, Apache Kafka, Kafka and associated open source project names are trademarks of the Apache Software Foundation.