14.13 PgxFrames Tabular Data-Structure

PgxFrame is a data-structure to load, store and manipulate tabular data. It contains rows and columns. A PgxFrame can contain multiple columns where each column consist of elements of the same data type, and has a name. The list of the columns with their names and data types defines the schema of the frame. (The number of rows in the PgxFrame is not part of the schema of the frame.)

PgxFrame provides some operations that also output PgxFrames (described later in the tutorial). Those operations can be performed in-place (meaning that the frame is mutated during the operation) in order to save memory. In place operations should be used whenever possible. However, we provide out-place variants, i.e., a new frame is created during the operation.

The following table lists all the in-place operations along with the respective out-place operations:

Table 14-8 Mapping between In-Place and Out-Place Operations

In-place operations Out-place operations
headInPlace head
tailInPlace tail
flattenAllInPlace flattenAll
renameColumnInPlace renameColumn
renameColumnsInPlace renameColumns
selectInPlace select