Skip to main content

Column Producers

All operations performed on data tables are represented using column producers, objects producing a list of columns.

The Concept

Data tables often handle linked data, data which is refreshed directly from the data source when the analysis is opened. The rows of a linked data source may change from one day to the next, and columns may be added, removed, or reordered. The content of a table can also be refreshed or replaced on user command.

There are many ways to modify a table. Columns can be added from an external data source, or calculated columns or hierarchies can be added to the table. Column producers represent all operations is such a way that they can be reapplied when data is updated. The priciple is straightforward: A column producer is an object that produces a list of columns.

See also:
  • Creating a Virtual Table Column Producer
    Some columns contain data that loads slowly, typically because of slow databases. Loading this kind of data into ordinary columns is impractical. Virtual column producers create columns that render only the cells actually viewed: Cell values are fetched on a need-to-view basis.
A join of two data sources

Column Producers at Work

The simplest kind of column producer, the source column producer, takes its columns directly from a data source. A more complex column producer behaves as an operator node in a parse tree: It takes input, a lists of columns, from one or more other column producers, then performs some action on the input, and finally produces a list of columns as its output. The figure shows a producer tree that performs a join between two data sources.

The column producers for a table usually form a tree similar to the one in the figure. The table will receive its public columns from the root producer in the tree. There is, however, no guarantee that a column producer will yield the same list of columns when it is invoked two or more times in succession. When a table is updated, the new set of columns must be mapped to the old set of columns.

The column nodes in a table are referenced from other parts of the document, such as visualizations and the filter panel. When the table is updated, events are propagated to the nodes connected to the modified columns. All components referring to tables and columns must be prepared to handle changes such as the removal of a column or an update of the rows.

Similarly, column producers like the join producer in the figure must be prepared to handle changes in their input. A join producer may be able to handle cases where columns are added gracefully, but in other cases such as when a column that was used to define the join operation is no longer present, it may be hard to produce a meaningful result.