- Record Components:
schema- the heading of every rowrows- the rows, in the order the query produced themevents- the optimizer, planner and execution events of this run, in arrival order
Relation.toList() answers the rows alone, which is what most callers want.
This is Relation.run()'s answer, for a caller who also wants to know
how: which rewrite rules fired, which join algorithm the planner chose, what
was pushed into a database and what was evaluated in-engine.
The last event is always the run's own cardinality — an EXECUTE/ROWS
event carrying EventMetrics.rows. It is stated as an event rather than as a
field so that a consumer reads one feed rather than one feed and a side channel, and it
is emitted by the terminal rather than by the executor because a row stream's length is
not known until something drains it.
The events are this run's own. That is worth stating because the
relix.events catalog relation cannot be: a statement's events postdate the
analysis that would have to register them, so in a session there they describe the
previous statement. An embedding has no such constraint — it runs the query and
then hands the caller the result — so what arrives here is the feed for the rows beside
it.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.events()Returns the value of theeventsrecord component.final inthashCode()Returns a hash code value for this object.booleanisEmpty()Returns whether the run produced no rows.iterator()rows()Returns the value of therowsrecord component.schema()Returns the value of theschemarecord component.intsize()Returns how many rows the run produced.final StringtoString()Returns a string representation of this record class.booleanReturns whether the session's sandbox cut this result short.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Rows
Canonical constructor; the lists are copied, so a result cannot change under its holder.- Since:
- 1.0
-
-
Method Details
-
size
public int size()Returns how many rows the run produced.- Returns:
- how many rows the run produced
- Since:
- 1.0
-
isEmpty
public boolean isEmpty()Returns whether the run produced no rows.- Returns:
- whether the run produced no rows
- Since:
- 1.0
-
truncated
public boolean truncated()Returns whether the session's sandbox cut this result short.A closed
Sandboxwith an output limit returns at most that many rows. When a query had more, the rows here are the first ones and this is true; the events then include theEXECUTE/TRUNCATEDevent that reported it.- Returns:
- whether the session's sandbox cut this result short
- Since:
- 1.0
-
iterator
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
schema
Returns the value of theschemarecord component.- Returns:
- the value of the
schemarecord component
-
rows
Returns the value of therowsrecord component.- Returns:
- the value of the
rowsrecord component
-
events
Returns the value of theeventsrecord component.- Returns:
- the value of the
eventsrecord component
-