All Known Implementing Classes:
ArrayRow, DocumentRow, QualifiedRow, Tuple

public interface Row
A single tuple produced during query execution — an ordered, named sequence of Values whose structure is described by a Schema.

Column lookup by name is case-insensitive, matching the conventions of the rest of the relix system. Positional access by index is also supported for internal use by operators that iterate columns in order.

Implementations must be immutable.

  • Method Summary

    Modifier and Type
    Method
    Description
    default List<String>
    Returns this row's column names in order.
    get(int index)
    Returns the value at the given zero-based column index.
    get(String columnName)
    Returns the value in the named column (case-insensitive).
    static Row
    of(Schema schema, Value... values)
    A row of values under schema, one value per column in order.
    static Row
    of(Schema schema, List<Value> values)
    A row of values under schema, one value per column in order.
    Returns the schema that describes this row's columns.
    int
    Returns the number of columns in this row.
  • Method Details

    • of

      static Row of(Schema schema, List<Value> values)
      A row of values under schema, one value per column in order.

      The row a connector produces: a RelixConnector reads its source and hands the engine rows built here.

      Parameters:
      schema - the row's columns; must not be null
      values - one value per column; must not be null, and its size must match
      Returns:
      the row
      Throws:
      IllegalArgumentException - if the counts differ
      Since:
      1.0
    • of

      static Row of(Schema schema, Value... values)
      A row of values under schema, one value per column in order.
      Parameters:
      schema - the row's columns; must not be null
      values - one value per column
      Returns:
      the row
      Throws:
      IllegalArgumentException - if the counts differ
      Since:
      1.0
    • schema

      Schema schema()
      Returns the schema that describes this row's columns.
      Returns:
      the row's schema; never null
    • get

      Value get(String columnName)
      Returns the value in the named column (case-insensitive).
      Parameters:
      columnName - the column name to look up
      Returns:
      the value; never null (absent values use NullValue.INSTANCE)
      Throws:
      IllegalArgumentException - if no column with that name exists
    • get

      Value get(int index)
      Returns the value at the given zero-based column index.
      Parameters:
      index - zero-based column index
      Returns:
      the value; never null
      Throws:
      IndexOutOfBoundsException - if index is out of range
    • width

      int width()
      Returns the number of columns in this row.
      Returns:
      column count; always ≥ 1
    • columnNames

      default List<String> columnNames()
      Returns this row's column names in order.

      For a closed-schema row these are the schema's column names. For an open (schema-on-read) row — see DocumentRow — the schema declares no columns, so implementations override this to report the document's actual top-level field names. This is what lets consumers (e.g. the result formatter) enumerate the columns of a heterogeneous, schema-less row.

      Returns:
      the ordered, possibly empty list of column names; never null