Skip to content
GoldNEW 5 min read 2 practice problems ↓

SQL pipe syntax

Write SQL top to bottom with the |> operator, in the order the query actually runs.

Step 2 · Spark internals · Gold · Spark 4, lesson 4 of 5

Read first: Catalyst and physical plans (skip if you know it)

In plain words first

A recipe lists its steps in order: chop, fry, season, serve. Classic SQL is like a recipe that starts with "serve" and lists the chopping at the end.

Pipe syntax writes the query like a recipe: FROM first, then each step after |>, in the order Spark runs them.

Unlock the full lesson

You have read the free part. The rest of this advanced lesson:

  • Why a new syntax
  • Side by side
  • Operators
  • Why engineers like it
  • Try it yourself
  • Common mistakes
  • Key takeaways
  • Interview prep with 3 follow-up questions
  • Check yourself: 3 questions

Unlock it with the Complete pass (every advanced problem and lesson) or on its own.

Practise this

Interview problems on spark performance, graded on hidden tests

Keep going

Up next · Spark 4 · lesson 5 of 5 · 6 min read
Python Data Source API
Write custom batch and streaming readers and writers for Spark in pure Python.

Related lessons

Previous: The VARIANT type

Primary sources: Spark SQL reference