Class UnboundedRelationException

All Implemented Interfaces:
Serializable

public class UnboundedRelationException extends RelixException
Thrown when a terminal that must collect every row is asked for one that never ends.

Relation.toList() and Relation.run() return when the rows are all in hand, so over an unbounded relation they would not return at all. The refusal is made before anything runs, and the remedy is in the caller's hands: bound the relation with limit(n), or take it lazily with Relation.stream(), which is what an endless relation is for.

The planner raises the same refusal for its own reason: an operator that must buffer its whole input — a sort, a grouping — cannot do so over an input that never ends, and it says so before reading a row. Both are the one fact a caller acts on, so both arrive as this type rather than as two.

Distinct from QueryExecutionException because nothing failed. The query is sound and the engine is willing; it is the shape of the question that cannot be answered by a list.

Since:
1.0
See Also:
  • Constructor Details

    • UnboundedRelationException

      public UnboundedRelationException(String message)
      Creates an exception with the given message.
      Parameters:
      message - what went wrong
      Since:
      1.0
    • UnboundedRelationException

      public UnboundedRelationException(String message, Throwable cause)
      Creates an exception with the given message and cause.
      Parameters:
      message - what went wrong
      cause - the underlying refusal
      Since:
      1.0