Table of Contents

Calcite - Projection relational operator

About

Projection relational operator in Calcite is a relational operator.

Features

Example

final RelNode node = builder
  .scan("EMP")
  .project(builder.field("DEPTNO"), builder.field("ENAME"))
  .build();
System.out.println(RelOptUtil.toString(node));
LogicalProject(DEPTNO=[$7], ENAME=[$1])
  LogicalTableScan(table=[[scott, EMP]])

equivalent to:

SELECT ename, deptno
FROM scott.EMP;

builder.field create simple expressions that return the fields from the input relational expression (ie the TableScan) by ordinal (order)

Documentation / Reference