Class ConnectByRootExpression

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

public class ConnectByRootExpression extends ColumnReferenceExpression
CONNECT_BY_ROOT <column>: the column's value on the ROOT row of the hierarchy branch that produced the current row.

The CONNECT BY expansion materializes the root row's values as extra ROOT_PREFIX-prefixed columns (hidden from SELECT *), so this is modelled as an ordinary ColumnReferenceExpression to that prefixed name. Used in a query WITHOUT a CONNECT BY clause the prefixed column is absent and Snowflake simply returns the column's own value (live-verified: SELECT CONNECT_BY_ROOT nm FROM h returns every row's nm) — baseColumnReference() is the fallback the evaluator uses for that case.

  • Field Details

    • ROOT_PREFIX

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

    • ConnectByRootExpression

      public ConnectByRootExpression(String baseTableName, String baseColumnName)
  • Method Details