Conversion

This page describes how to use conversion or CAST functions in Lenses SQL Processors.

CAST

CAST (dt AS int)

Enables conversion of values from one data type to another.

Available in:

ProcessorsSQL Studio

Sample code

USE `kafka`;
SELECT 
    CAST(price as INT),
    price 
FROM products-events
LIMIT 1;

Output:

{
  "value": {
    "alias": 2, # new value
    "price": 2.46 # old value
  }
}

Last updated

Logo

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