TO_TIMESTAMP

This page describes the TO_TIMESTAMP function in Lenses SQL.

TO_TIMESTAMP(longExpr)

Converts a string representation of a date into epoch value using the pattern provided.

TO_TIMESTAMP (strExpr, pattern)

Converts a string using a pattern to a date and time type.

Available in:

ProcessorsSQL Studio

Sample code:

USE `kafka`;
SELECT 
    TO_TIMESTAMP(tpep_pickup_datetime),
    tpep_pickup_datetime 
FROM nyc-yellow-taxi-trip
LIMIT 1;

Output:

{
  "value": {
    "TO_TIMESTAMP": "2016-01-01T00:00:02Z",
    "tpep_pickup_datetime": "2016-01-01 00:00:02"
  }
}

Last updated

Logo

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