CONTAINS

This page describes the CONTAINS function in Lenses SQL.

CONTAINS(sourceExpr,targetExpr)

Returns true if an expression contains the given substring.

Available in:

ProcessorsSQL Studio

Sample code:

USE `kafka`;
SELECT 
    CONTAINS(first_name, 'A'), 
    first_name first_name 
FROM users-topic
LIMIT 2;

Output:

{
  "value": {
    "CONTAINS": false,
    "first_name": "Jose"
  }
}
{
  "value": {
    "CONTAINS": true,
    "first_name": "Amy"
  }
}

Last updated

Logo

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