ELEMENT_OF

This page describes the ELEMENT_OF function in Lenses SQL.

ELEMENT_OF(array, index)

Return the element of array at index.

Available in:

ProcessorsSQL Studio

Sample code:

USE `kafka`;
SELECT ELEMENT_OF(products, 2) 
FROM orders-events
LIMIT 1;

Output:

{
  "value": {
    "ELEMENT_OF": {
      "product_id": "d3f085e0-c049-4e8b-9dd9-ea3ae124720b",
      "quantity": 1
    }
  }
}

Last updated

Logo

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