Skip to content
Telemetry
Reproducible SQL cookbook

How every Telemetry SQL recipe is tested

Automated checks verify that each query runs on the tested SQL engine. People review what the results mean. Synthetic data can test a query, but your team still needs to check its business rules.

Reviewed by the Telemetry product team on . We checked the test script, sample data definitions, SQL engine version, and what the tests cover. Who reviews this page

Current test target

Apache DataFusion 45.2.0

82

queries in the suite

0

write statements allowed

Automated quality gate

Five checks before a recipe is published

1

Complete recipe contract

The audit requires a question, event schema, SQL, sample result, visualization, explanation, edge cases, dashboard guidance, alert guidance, and related reading.

2

Read-only statement policy

Queries must start with SELECT or WITH. The audit rejects DDL and write keywords such as CREATE, INSERT, UPDATE, DELETE, DROP, ALTER, and MERGE.

3

Typed DataFusion execution

Each schema becomes an empty Apache Arrow record batch. The query is planned and executed with Apache DataFusion 45.2.0, catching invalid columns, types, functions, and syntax.

4

Reproducible browser fixtures

31 cross-category recipes also execute their complete synthetic input with DuckDB 1.3.2 and compare every expected result value within displayed precision.

5

Rendered-page integrity

The site audit renders every recipe and checks its status, canonical URL, title, description, H1, structured data, and internal links.

What the execution check proves

The audit constructs every documented table from the field names and Arrow types shown on the recipe page. It registers an empty batch in a fresh DataFusion session, runs the exact published SQL, and fails if the engine rejects the plan or execution. This catches misspelled fields, incompatible operations, unsupported functions, ambiguous columns, malformed intervals, and many return-type mistakes without requiring production data.

The pinned version is intentional. SQL engines evolve, so a query is not labeled compatible merely because a similar dialect accepts it. When the application upgrades DataFusion, the full collection is rerun before the documented version changes.

Adapt the business rules before using the query

Your team defines an active account, a recovered payment, a permanent webhook failure, and acceptable latency. Each recipe identifies the rules to check before using it for a dashboard or alert.

Human review

What still needs judgment

An empty typed table proves that a query plans and executes; it does not prove that a business definition is correct.

Displayed rows and charts are deterministic synthetic examples. They show the output shape and intended interpretation, not a benchmark or customer result.

Thresholds, minimum volumes, time windows, identity rules, currencies, and terminal statuses must be adapted to the event contract that owns them.

Late events, duplicated provider deliveries, incomplete newest buckets, and schema changes can alter real results even when the SQL is valid.

What the sample download contains

Each recipe has a downloadable JSON bundle with its schema, sample input, SQL, expected output, engine version, and review notes. Download the displayed results as CSV or the chart as SVG. The sample input shows field names and types. It may not contain enough rows to reproduce the full result.

The 31 reproducible recipes include all the sample rows needed to run the query in the browser SQL playground and check the output against expected values. Other recipes include only enough sample rows to show the schema. Those smaller samples cannot validate the full result.

The connected SQL Lab uses a separate, versioned SaaS dataset for practicing joins and queries with several steps. All its rows are synthetic.

Primary engine references

Apache publishes the authoritative SQL syntax, function, type, and upgrade documentation. The live reference may describe a newer release than Telemetry's pinned test target, so compatibility claims on recipe pages continue to name the exact audited version.

Test a recipe with your event fields

Match the field names and types to your events. Send sample rows for known successes and failures, then check each CTE and compare the totals with your inputs. Save the counting rules alongside the query.