COALESCE

This page describes the COALESCE function in Lenses SQL.

COALESCE(value, prevValue)

Returns the first non-null expression in the expression list.

Available in:

ProcessorsSQL Studio

Sample code:

USE `kafka`;
SELECT 
    COALESCE(modified_at, "not updated") AS modified_at 
FROM users-events
WHERE modified_at IS NULL
LIMIT 1;

Output:

{
  "value": {
    "modified_at": "not updated"
  }
}

In case you want to know more about nullability scenarios, see here.

Last updated

Logo

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