« Back to index
Table of Contents
- Native types
Types are very useful.
The following native types are supported.
|boolean||Boolean values, ie. true or false|
|double||Double precision floating point|
|float||Single precision floating point|
|string||String of characters|
A string representing a duration in time. It can be defined as follows:
# is a positive number between 0 and 999999 and
x is an optional letter from the following table:
|none||Duration in milliseconds|
|s||Duration in seconds|
|m||Duration in minutes|
|h||Duration in hours|
|d||Duration in days|
|w||Duration in weeks|
100 ==> hundred milliseconds 30s ==> thirty seconds 8h ==> eight hours 2w ==> two weeks
Avro types are supported through the “avro” prefix in types. The notation is
avro:schema, where schema is the schema fqdn, or just the schema name itself.
On Kafka topics, Avro types are serialized in binary format. Internally they are represented as records.
Note: when referencing a schema, please ensure that the respective Avro schema file can be found in the KSML working directory.
Some Kafka Streams operations modify the key type from K to Windowed<K>. KSML generates an AVRO schema on-the-fly for any windowed type. These Avro windowed definitions will not be found on disk, so during the loading of the KSML definition this may lead to problems. To circumvent, use the following notation to refer to a windowed key type:
JSON is supported through built-in serializers and deserializers. The representation on Kafka will always be
string. Internally JSON objects are either records or lists.
For windowed keys, the JSON representation modifies the Windowed type to a plain JSON object, containing 4 timestamp fields and a key field with the original key.