IN_ARRAY

This page describes the IN_ARRAY function in Lenses SQL.

IN_ARRAY(element, array)

Check if element is an element of array.

Available in:

ProcessorsSQL Studio

Sample code:

USE `kafka`;
SELECT 
    IN_ARRAY('5ec69520-258f-4669-915f-9d842f96fa14', products), 
    products 
FROM orders-test-4
LIMIT 10;

Output:

{
  "value": {
    "IN_ARRAY": true,
    "products": [
      "5ec69520-258f-4669-915f-9d842f96fa14",
      "1946c4ac-ea7a-48c5-870c-1800c3982a14"
    ]
  }
}
{
  "value": {
    "IN_ARRAY": false,
    "products": [
      "49c537d5-078f-4bf8-a74d-49aa10e39c31",
      "c1eb9291-f292-4079-8957-88cce18c2739"
    ]
  }
}

Last updated

Logo

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