ELEMENT_AT_KEY

All functions > ARRAY > ELEMENT_AT_KEY

Returns one element at the given key from the given index, array or array of rows.

Syntax

ELEMENT_AT_KEY(index: INDEX, key: K, base: ARRAY<ROW<T>>) → ROW<T>
sql

Type Parameters:

  • K: Any hashable type

  • T: Any type

Arguments

ParameterTypeRequiredDescription
indexINDEXYesIndex to look up position from
keyKYesKey to look up in the index
baseARRAY<ROW<T>>YesArray or array of rows to extract element from

Returns

ROW - Single element at the position indicated by index[key]

Notes

  • Uses index to map key to array position
  • Looks up key in index to find position
  • Returns element at that position from base array
  • Returns NULL if key not found in index
  • Useful for efficient lookups with pre-computed indexes
Last update at: 2025/10/13 10:23:46