Getting Started

Tutorial: Building with CleaveDB

Pipeline (PIPE) — Overview

In complex analytical workflows, data transformations are rarely solved in a single isolated step. Rather than running separate queries and stitching results together in your application layer, CleaveQL introduces the PIPE command for multi-stage stream processing directly within the engine.

Pipeline structure

Every pipeline starts with PIPE FROM <bucket>, followed by one or more stages linked by the THEN keyword:

StageCanonical syntaxPipeline role
FilterTHEN WHERE age > 20Filters stream by boolean conditions
SortTHEN ARRANGED BY age GOING DOWNSorts stream ascending (UP) or descending (DOWN)
LimitTHEN LIMIT 3Caps the maximum records emitted
ProjectTHEN SHOW name, ageSelects and yields specific fields
Group & AggregateTHEN GROUP BY city TALLY AS nPartitions stream and computes reductions

Explore the Pipeline topics

Learn how to compose flexible analytical pipelines using CleaveQL: