Understanding schemas
A schema is a way of describing a nested structure of a Java object. A typical Java object contains fields that have string names and data types.
Let's see the following Java class:
public class Position { double latitude; double longitude; }
This class has two fields called latitude
and longitude
, respectively, both of which are of the double
type. The matching Schema
property of this class would be as follows:
Position: Row latitude: double longitude: double
This notation declared a Position
type with a schema of the Row
type containing two fields, latitude
and longitude
, both of the double
type. A Row
is one of Apache Beam's built-in schema types with a nested structure – the others are Array
, Iterable
, and Map
with their usual definitions in computer science. The difference between Array
and Iterable
is that Iterable
does not have a known size until it's iterated over. This...