- Record Components:
left- the left-hand side of the equation; must not be nullright- the right-hand side of the equation; must not be nullinput- the relation whose rows are completed; must not be nulllocation- the source location of this node; never null
- All Implemented Interfaces:
RelNode
left = right.
For each input row, the participating columns are the distinct
attribute references appearing anywhere in left or right.
Whichever single participating column is NULL in that row is
the unknown: solve rearranges the equation to compute it and emits the
completed row. The direction is therefore per-row — the same equation fills
principal in one row and rate in another, depending on which is
blank.
Rows that do not have exactly one NULL participating column pass
through unchanged: a fully-populated row is already complete (no recompute or
validation), and a row with two or more blanks is underdetermined (its
NULLs are left intact).
The output schema equals the input schema — solve fills holes, it
never adds or removes columns. Both sides are restricted to invertible
arithmetic (column references, numeric literals, + − × ÷ and unary
minus), and each participating column may appear at most once across the whole
equation, so the inversion is deterministic regardless of which column is the
runtime unknown. This operator runs in-engine and never pushes down.
Example: SOLVE total = principal * rate (Loans) fills whichever of
total, principal, or rate is blank in each loan row.
-
Constructor Summary
ConstructorsConstructorDescriptionConvenience constructor for tests; usesSourceLocation.UNKNOWN.SolveNode(Operand left, Operand right, RelNode input, SourceLocation location) Creates an instance of aSolveNoderecord class. -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(RelNodeVisitor<R> visitor) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.input()Returns the value of theinputrecord component.left()Returns the value of theleftrecord component.location()Returns the value of thelocationrecord component.right()Returns the value of therightrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.darkcollective.relix.ast.RelNode
children, mapChildren, materializationMode, prettyPrint
-
Constructor Details
-
SolveNode
Creates an instance of aSolveNoderecord class. -
SolveNode
Convenience constructor for tests; usesSourceLocation.UNKNOWN.
-
-
Method Details
-
accept
-
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). -
left
Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-
right
Returns the value of therightrecord component.- Returns:
- the value of the
rightrecord component
-
input
Returns the value of theinputrecord component.- Returns:
- the value of the
inputrecord component
-
location
Returns the value of thelocationrecord component.
-