liveBook · Manning

Hierarchy

As explained in Kafka Streams in Action, Second Edition

A nested structure is a hierarchical data structure whose fields or elements can themselves contain structured values.

Nested data organizes fields inside other structured values. In ksqlDB, model each nested object with STRUCT, including its field names and types. section 11.6

Work with nested fields by following the structure:

  • Define every object as STRUCT<field type, ...>, nesting STRUCT declarations when objects contain other objects. section 11.6
  • Dereference nested fields with ->, repeating the path for deeper objects; use an index to select an array entry. section 11.6

Course recommendations from a school event

A JSON event can contain a student, class, professor, and the professor's other classes. Query event->student->id and event->class->professor->other_classes to emit a student identifier and suggested courses.

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Defines nested STRUCT schemas and chained field access, but does not detail broader schema-management concerns.
Examples
Uses a school-event JSON schema, nested stream definition, course-recommendation query, and indexed array lookup.
What it assumes
Assumes familiarity with ksqlDB streams and basic JSON fields while teaching nested schema and access syntax.
What you can do after
Apply it via ksqlDB to define streams and retrieve deeply nested fields and array entries.
How it connects
Connects STRUCT, JSON, arrays, ksqlDB streams, and field dereferencing.

Also explained in

Compare how 7 books explain hierarchy →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka Streams in Action, Second Edition. The section links point to the parts of the book it draws on.