Calcite - Projection relational operator

Card Puncher Data Processing

Calcite - Projection relational operator

About

Projection relational operator in Calcite is a relational operator.

Features

  • name expressions using alias(expr, fieldName)

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)

  • ie 7 (column at the position 7)
  • and 1 (column at the position 1)

Documentation / Reference





Discover More
Card Puncher Data Processing
Calcite - Field

in calcite. You can reference a field (cell) by name or ordinal. Ordinals are zero-based. Each operator guarantees the order in which its output fields occur. For example, Project returns the fields...
Card Puncher Data Processing
Calcite - Relational Expression (RelNode, Algebra)

Relational Algebra in Calcite A relational expression is represented by a tree of RelNode. A RelNode can be considered as the same logic than the Spark dataframe. TableScan Project Filter...
Card Puncher Data Processing
Calcite - Relational Operator (RelNode)

in Calcite. They are used to build a relational expression. Because of the chaining nature of a relational expression, a relational operator is also a relational expression and share the same interface...



Share this page:
Follow us:
Task Runner