Class RepeatedListWriter

All Implemented Interfaces:
ArrayWriter, ColumnWriter, WriterEvents, WriterPosition

public class RepeatedListWriter extends ObjectArrayWriter
Implements a writer for a repeated list. A repeated list is really an array of arrays. It is an "array" because it does not support nulls. (The Drill [non-repeated] "list vector" does support nulls.) The terminology is confusing, but it is what Drill has settled upon.

Because repeated lists can be nested, they support incremental construction. Build the outer array, then the inner, then the leaf to build a 3D array. Since building is incremental, this form of array must track state and use the state to keep the newly-added element writer in sync.

To keep things (relatively) simple, the repeated list array starts out with an inner list. For the row set writer, the inner list is the actual element writer. For the result set loader, the inner list is a dummy, to be replaced by the real one once it is discovered by reading data (or by parsing a schema.)