Record Class PhysicalNode.LateralJoin

java.lang.Object
java.lang.Record
com.darkcollective.relix.plan.PhysicalNode.LateralJoin
Record Components:
functionName - the TVF name, for display and debugging
arguments - the argument Operand expressions (may reference left columns); evaluated per left row at execution time
bodyBuilder - given the per-row argument literals, returns the planned physical body for that invocation
deterministicBody - whether the function body evaluates to the same relation every time it is run — decided by the planner, which can see the body the executor only receives a bodyBuilder() for. The executor may reuse one execution's rows across outer rows carrying the same arguments only when this is true; the planned body itself is reusable either way, since planning does not evaluate anything
All Implemented Interfaces:
PhysicalNode
Enclosing interface:
PhysicalNode

public static record PhysicalNode.LateralJoin(Schema schema, String functionName, List<Operand> arguments, Function<List<Operand>,PhysicalNode> bodyBuilder, boolean deterministicBody, PhysicalNode left) extends Record implements PhysicalNode
Lateral / correlated table-valued function join: for each row of left(), evaluates the arguments() in that row's context, binds them into the function body via bodyBuilder(), plans the instantiated body, and concatenates the left row with each row the body produces.

The bodyBuilder() captures the function body, the planner, and the schema-annotation map: given the argument expressions with parameter references already replaced by their current literal values, it returns a ready-to-execute PhysicalNode. This keeps all inlining and re-planning logic in the planner rather than the executor.

Output schema = left schema ++ TVF return schema. Never pushed to a source.

  • Constructor Details

    • LateralJoin

      public LateralJoin(Schema schema, String functionName, List<Operand> arguments, Function<List<Operand>,PhysicalNode> bodyBuilder, boolean deterministicBody, PhysicalNode left)
      Creates an instance of a LateralJoin record class.
      Parameters:
      schema - the value for the schema record component
      functionName - the value for the functionName record component
      arguments - the value for the arguments record component
      bodyBuilder - the value for the bodyBuilder record component
      deterministicBody - the value for the deterministicBody record component
      left - the value for the left record component
  • Method Details

    • children

      public List<PhysicalNode> children()
      Description copied from interface: PhysicalNode
      Direct child plans, left-to-right; empty for a PhysicalNode.Scan.
      Specified by:
      children in interface PhysicalNode
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • schema

      public Schema schema()
      Returns the value of the schema record component.
      Specified by:
      schema in interface PhysicalNode
      Returns:
      the value of the schema record component
    • functionName

      public String functionName()
      Returns the value of the functionName record component.
      Returns:
      the value of the functionName record component
    • arguments

      public List<Operand> arguments()
      Returns the value of the arguments record component.
      Returns:
      the value of the arguments record component
    • bodyBuilder

      public Function<List<Operand>,PhysicalNode> bodyBuilder()
      Returns the value of the bodyBuilder record component.
      Returns:
      the value of the bodyBuilder record component
    • deterministicBody

      public boolean deterministicBody()
      Returns the value of the deterministicBody record component.
      Returns:
      the value of the deterministicBody record component
    • left

      public PhysicalNode left()
      Returns the value of the left record component.
      Returns:
      the value of the left record component