Class PriorExpression

java.lang.Object
dev.frostlake.executor.expressions.ColumnReferenceExpression
dev.frostlake.executor.expressions.PriorExpression
All Implemented Interfaces:
Expression

public class PriorExpression extends ColumnReferenceExpression
PRIOR <column> inside a CONNECT BY predicate: the column's value on the PARENT row of the hierarchy step being considered, as opposed to the candidate child row every other reference reads.

The hierarchy expansion evaluates the predicate against a combined row that carries the candidate's values followed by the parent's, exposed under PRIOR_PREFIX-prefixed column names — so this is modelled as an ordinary ColumnReferenceExpression to that prefixed name and every consumer that pattern-matches on column references (equi-key extraction, GROUP BY resolution, the AST printer) keeps working unchanged. Outside a CONNECT BY the prefixed column does not exist, and the evaluator turns the lookup failure into an explicit "PRIOR is only allowed in a CONNECT BY clause" error.

  • Field Details

    • PRIOR_PREFIX

      public static final String PRIOR_PREFIX
      Prefix of the synthesized parent-row column names produced by the CONNECT BY expansion.
      See Also:
  • Constructor Details

    • PriorExpression

      public PriorExpression(String baseColumnName)
  • Method Details