liveBook · Manning

Dereferencing syntax

As explained in Kafka Streams in Action, Second Edition

Dereferencing syntax is expression notation for accessing a nested field or element through an enclosing structured value.

Dereferencing syntax uses the -> operator to reach fields inside nested STRUCT values in ksqlDB queries. Each operator advances through one enclosing structure. section 11.6

Use the same path-based pattern for nested values and collections:

  • Access a map entry with map_name['key'], then continue dereferencing if the entry is another STRUCT. section 11.6

Course recommendation query

A school-event stream can project event->student->id, event->student->email, and event->class->professor->other_classes. Selecting an indexed array entry narrows the recommendation to one course.

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Explains multi-level STRUCT traversal, array indexing, and map lookup, without detailing parser or execution internals.
Examples
Demonstrates student-event projections, professor course recommendations, and selecting one array entry.
What it assumes
Assumes familiarity with ksqlDB queries and structured event schemas while demonstrating nested STRUCT declarations from their fields.
What you can do after
Apply via ksqlDB to query nested STRUCT fields and retrieve array or map elements.
How it connects
Connects nested data with STRUCT datatypes, arrays, maps, JSON, and ksqlDB streams.

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.