Course: ksqlDB 101

Transforming Data with ksqlDB

2 min
Allison WaltherIntegration Architect (Course Presenter)
Robin MoffattStaff Developer Advocate (Course Author)

Transforming Data with ksqlDB

ksqlDB allows you to transform events in one stream and then send them to a new stream. For example, you may want to change a Unix timestamp to a human-readable format, or you may want to remove sensitive fields from a stream for broader use within a company.

ksqlDB can be used to perform many common transformations required when handling data, including:

  • Changing data types (CAST)
  • Reformatting date/time fields (TIMESTAMPTOSTRING)
  • Changing field names (AS)
  • Dropping fields
  • Concatenating fields (CONCAT)

When creating a new stream from an existing one, you can pick and choose the fields you’d like to preserve in the new stream. You can also use functions to modify data or to create derived fields.

For example, here is how to convert the timestamps on your orders from the Unix epoch value to a more friendly data format:

orders-no-address

There is really no limit to the transformations you can perform with ksqlDB.

Use the promo code KSQLDB101 to get $101 of free Confluent Cloud usage

Be the first to get updates and new content

We will only share developer content and updates, including notifications when new content is added. We will never send you sales emails. 🙂 By subscribing, you understand we will process your personal information in accordance with our Privacy Statement.