Simple Schemas

A Simple Schema defines the fields outside of the strmMeta section in a simple format, and translates this to an actual Avro avsc definition.

In the quickstart Simple Schema example we have a hands-on interaction that shows the technical details

A simple schema defines a list of nodes. Each node is an entity with the following attributes:

  • name (required) that you can use to access the entity.

  • avro_name (optional) conforms to the naming rules for Avro. Is derived from name unless it was explicitly set.

  • type (required) an integer, string, float or a node

  • repeated (optional) that defines whether or not the field can occur more than once. Defaults to false.

  • required (optional) that defines whether or not the sender must fill in this field value. Defaults to false.

  • doc (optional) documents the purpose of the field.

  • nodes (optional) holds child-nodes for nested data structure. This is only valid when the type is NODE

An example of a simple schema:

name: Clicks
- name: Session Id
  type: STRING
  doc: the string value that connects events to a single sequence
- name: User Name
  type: STRING
  doc:  we use an event contract to define that this is private
- name: url
  type: STRING
  doc:  the url on the website
- name: Prijs in GB£
  type: FLOAT
  doc:  price in UK pounds
- name: mouse positions
  repeated: true
  type: NODE
  - name: x
    type: INTEGER
  - name: "y"  # warning. Put quotes around y or it is a boolean true:
    type: INTEGER