SQL Overview

Process streaming data using familiar SQL syntax.

6 min readSQL Processing

Streaming SQL Engine

StreamHouse includes a built-in SQL engine powered by Apache DataFusion. It allows you to query streaming data using standard SQL, create materialized views, and run continuous queries. This eliminates the need for a separate stream processing framework like Flink or ksqlDB for many common use cases.

What You Can Do

The SQL engine supports a wide range of operations on streaming data.

  • Query topics as SQL tables with SELECT, WHERE, GROUP BY, and ORDER BY
  • Create continuous queries that run indefinitely and write results to new topics
  • Define windowed aggregations (tumbling, hopping, session windows)
  • Join multiple streams together in real-time
  • Use built-in functions for JSON parsing, timestamp manipulation, and math

Getting Started

You can run SQL queries through the web console's SQL Workbench, the CLI, or the REST API.

bash
# Using the CLI
streamctl sql "SELECT * FROM user_events WHERE event = 'purchase' LIMIT 10"

# Interactive SQL shell
streamctl sql --interactive

# Using the REST API
curl -X POST http://localhost:8080/api/sql \
  -H "Content-Type: application/json" \
  -d '{"query": "SELECT count(*) FROM user_events"}'