Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Adding an SQL Operator

Joy Arulraj edited this page Jan 21, 2016 · 8 revisions

Introduction

The current architecture of Peloton contains a mix of both PostgreSQL components and our own components. In particular, we use the SQL parser and planner of Postgres, and then we use our own execution engine to execute these generated plans. We also use our own storage engine to store the databases. More information on the tile-based architecture of our execution and storage engines is available here.

Adding an operator

Before going about adding an operator, you might want to look at existing Peloton operators in src/backend/executor. In particular, the limit operator is kind of straightforward.

All the operators inherit from the abstract operator class. In particular, each operator has a Init and Execute functions. These functions should initialize/reinitialize and execute the respective operator.

When a parent operator invokes the Execute function of a child operator, the child operator returns false if and only if it has already returned all the logical tiles it has produced to the parent operator. It will never return an empty logical tile. Otherwise, the child operator returns true, and the parent operator can use GetOutput to obtain the logical tile produced by the child operator. A parent operator can, therefore, repeatedly invoke Execute function of a child operator to obtain all the logical tiles produced by the child operator.

Clone this wiki locally