For the complete documentation index, see llms.txt. This page is also available as Markdown.

YEAR

This page describes the YEAR function in Lenses SQL.

YEAR(expr)

Extracts the year component of an expression that is of type timestamp.

Available in:

Processors
SQL Studio

Sample code:

USE `kafka`;
SELECT 
    YEAR(_meta.timestamp),
    _meta.timestamp 
FROM nyc-yellow-taxi-trip
LIMIT 1;

Output:

{
  "value": {
    "YEAR": 2023,
    "timestamp": "2023-11-28T20:28:45.41Z"
  }
}

Last updated

Was this helpful?