- 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 TypeMethodDescriptionReturns this row's column names in order.get(int index) Returns the value at the given zero-based column index.Returns the value in the named column (case-insensitive).static RowA row ofvaluesunderschema, one value per column in order.static RowA row ofvaluesunderschema, one value per column in order.schema()Returns the schema that describes this row's columns.intwidth()Returns the number of columns in this row.
-
Method Details
-
of
A row ofvaluesunderschema, one value per column in order.The row a connector produces: a
RelixConnectorreads its source and hands the engine rows built here.- Parameters:
schema- the row's columns; must not be nullvalues- 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
A row ofvaluesunderschema, one value per column in order.- Parameters:
schema- the row's columns; must not be nullvalues- 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
Returns the value in the named column (case-insensitive).- Parameters:
columnName- the column name to look up- Returns:
- the value; never
null(absent values useNullValue.INSTANCE) - Throws:
IllegalArgumentException- if no column with that name exists
-
get
Returns the value at the given zero-based column index.- Parameters:
index- zero-based column index- Returns:
- the value; never
null - Throws:
IndexOutOfBoundsException- ifindexis out of range
-
width
int width()Returns the number of columns in this row.- Returns:
- column count; always ≥ 1
-
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
-