This file maps documentation snippets to complete, runnable example files.
Documentation (docs/) contains simplified code snippets for explanation.
Examples (examples/) contains complete, tested, runnable programs.
This mapping helps you find the full implementation of concepts shown in the docs.
flowchart TD
Start([📖 Reading Documentation]) --> Question{Want to run<br/>this code?}
Question -->|Yes| Table[📋 Check Quick Reference<br/>Table Below]
Question -->|No| Read[💡 Keep Reading]
Table --> Find[🔍 Find Example File Path]
Find --> Navigate[💻 Navigate to Directory<br/>cd examples/category/]
Navigate --> Run[▶️ Run Example<br/>python file.py]
Run --> Success[✅ Working Code!]
Read --> Later[🔖 Bookmark for Later]
style Start fill:#e1f5ff
style Success fill:#d4edda
style Table fill:#fff3cd
flowchart TD
Start2([💻 Have Example File Open]) --> Question2{Need to understand<br/>the concepts?}
Question2 -->|Yes| CheckMap[📋 Check This MAPPING.md]
Question2 -->|No| Code[✨ Start Coding!]
CheckMap --> FindDocs[📚 Find Related Docs Section]
FindDocs --> ReadDocs[📖 Read Conceptual Explanation]
ReadDocs --> Understand[💡 Better Understanding]
Understand --> Code
Code --> Success[🚀 Build Something Great!]
style Start2 fill:#e1f5ff
style Success fill:#d4edda
style CheckMap fill:#fff3cd
| Documentation Topic | Runnable Example(s) | Location |
|---|---|---|
| Getting Started | ||
| Basic TPC-H usage | duckdb_tpch_power.py |
getting_started/local/ |
| Basic TPC-DS usage | duckdb_tpcds_power.py |
getting_started/local/ |
| NYC Taxi analytics | duckdb_nyctaxi.py |
getting_started/local/ |
| TSBS DevOps time-series | duckdb_tsbs_devops.py |
getting_started/local/ |
| Databricks setup | databricks_tpch_power.py |
getting_started/cloud/ |
| BigQuery dry-run | bigquery_tpch_dry_run.py |
getting_started/cloud/ |
| Query subset | duckdb_tpch_query_subset.py |
getting_started/intermediate/ |
| Features | ||
| Test types (Power/Throughput/Maintenance) | test_types.py |
features/ |
| Query subsetting | query_subset.py |
features/ |
| Tuning comparison | tuning_comparison.py |
features/ |
| Result analysis | result_analysis.py |
features/ |
| Multi-platform execution | multi_platform.py |
features/ |
| Export formats | export_formats.py |
features/ |
| Validation mode | validation.py |
features/ |
| Batch execution | batch_execution.py |
features/ |
| Dry-Run Mode | ||
| Basic dry-run | basic_dry_run.py |
dry_run/ |
| Analyzing dry-run output | analyze_dry_run_output.py |
dry_run/ |
| Query validation | query_validation.py |
dry_run/ |
| Documentation generation | documentation_generator.py |
dry_run/ |
| CI/CD integration | ci_validation.py |
dry_run/ |
| Sample artifacts | Various .sql, .json files |
dry_run_samples/ |
| Use Cases | ||
| CI/CD testing | ci_smoke_tests.py |
use_cases/ |
| Platform evaluation | platform_comparison.py |
use_cases/ |
| Incremental tuning | incremental_tuning.py |
use_cases/ |
| Cost optimization | cost_optimization.py |
use_cases/ |
| Programmatic Workflows | ||
| Unified runner (advanced) | unified_runner.py |
programmatic/ |
| Custom workflow pattern | custom_workflow.py |
programmatic/ |
| Data pipeline integration | data_pipeline_integration.py |
programmatic/ |
| Results aggregation | aggregate_results.py |
programmatic/ |
| Automated reporting | generate_report.py |
programmatic/ |
| Configuration validation | validate_config.py |
programmatic/ |
| Benchmark orchestration | orchestrate_benchmarks.py |
programmatic/ |
| Multi-environment testing | multi_environment.py |
programmatic/ |
| Notebooks | ||
| DuckDB interactive | duckdb_tpch.ipynb |
notebooks/ |
| Databricks interactive | databricks_tpch.ipynb |
notebooks/ |
| BigQuery interactive | bigquery_tpch.ipynb |
notebooks/ |
| Snowflake interactive | snowflake_tpch.ipynb |
notebooks/ |
| Redshift interactive | redshift_tpch.ipynb |
notebooks/ |
| ClickHouse interactive | clickhouse_tpch.ipynb |
notebooks/ |
| DuckDB CLI interactive | duckdb_cli_tpch.ipynb |
notebooks/ |
| Postgres interactive | postgres_tpch.ipynb |
notebooks/ |
| Results analysis | analyze_results.ipynb |
notebooks/ |
| Platform comparison | compare_platforms.ipynb |
notebooks/ |
| Tuning optimization | tuning_optimization.ipynb |
notebooks/ |
| Configuration | ||
| Platform configs | Various .yaml files |
tunings/platforms/ |
| TPC-H tunings | Various tpch_*.yaml files |
tunings/benchmarks/ |
| TPC-DS tunings | Various tpcds_*.yaml files |
tunings/benchmarks/ |
| Benchmark Documentation | ||
| TPC-H guide | duckdb_tpch_power.py |
docs/benchmarks/tpc-h.md |
| TPC-DS guide | duckdb_tpcds_power.py |
docs/benchmarks/tpc-ds.md |
| NYC Taxi guide | duckdb_nyctaxi.py |
docs/benchmarks/nyctaxi.md |
| TSBS DevOps guide | duckdb_tsbs_devops.py |
docs/benchmarks/tsbs-devops.md |
| TPC-H Data Vault guide | Via unified_runner.py |
docs/benchmarks/datavault.md |
| TPC-H Skew guide | Via unified_runner.py |
docs/benchmarks/tpch-skew.md |
| Platform Documentation | ||
| PostgreSQL setup | Via unified_runner.py |
docs/platforms/postgresql.md |
| Trino setup | Via unified_runner.py |
docs/platforms/trino.md |
| Athena setup | Via unified_runner.py |
docs/platforms/athena.md |
| Firebolt setup | Via unified_runner.py |
docs/platforms/firebolt.md |
| Spark setup | Via unified_runner.py |
docs/platforms/spark.md |
| Polars setup | Via unified_runner.py |
docs/platforms/polars.md |
Docs: docs/usage/getting-started.md - "Running Your First Benchmark"
Examples:
examples/getting_started/local/duckdb_tpch_power.py- Complete local exampleexamples/getting_started/cloud/databricks_tpch_power.py- Cloud example
Key differences:
- Docs show minimal code for clarity
- Examples include error handling, logging, command-line arguments, dry-run support
Docs: docs/usage/examples.md - "Test Types" section (lines ~50-150)
Example: examples/features/test_types.py
Covers:
- Power Test (sequential queries)
- Throughput Test (concurrent streams)
- Maintenance Test (data refresh)
Docs: docs/usage/examples.md - "Query Subset" section (lines ~200-250)
Examples:
examples/features/query_subset.py- Feature demonstrationexamples/getting_started/intermediate/duckdb_tpch_query_subset.py- Beginner-friendly
Key differences:
- Docs use
queries=[1, 6]inline - Examples support CLI arguments:
--queries 1,6,12
Docs:
docs/usage/dry-run.md- Complete dry-run guidedocs/usage/examples.md- "Dry-Run Examples" section
Examples:
examples/dry_run/basic_dry_run.py- Simple dry-run executionexamples/dry_run/analyze_dry_run_output.py- Programmatic analysisexamples/dry_run/query_validation.py- SQL validation with sqlfluffexamples/dry_run/documentation_generator.py- Auto-generate docsexamples/dry_run/ci_validation.py- CI/CD integration
Sample output: examples/dry_run_samples/
Docs: docs/platforms/index.md - Platform-specific setup guides
Examples:
examples/tunings/platforms/- Complete configuration filesexamples/getting_started/cloud/- Minimal working examples
Covers:
- DuckDB, Databricks, BigQuery, Snowflake, Redshift, ClickHouse, Postgres
Docs: docs/usage/examples.md - "Result Analysis" section (lines ~400-500)
Examples:
examples/features/result_analysis.py- Programmatic analysisexamples/notebooks/result_analysis_patterns.ipynb- Interactive analysis
Docs: docs/usage/examples.md - "Multi-Platform" section (lines ~550-650)
Examples:
examples/features/multi_platform.py- Sequential executionexamples/use_cases/platform_evaluation.py- Comparison workflowexamples/notebooks/platform_comparison.ipynb- Interactive comparison
Docs: docs/advanced/ci-cd-integration.md
Examples:
examples/dry_run/ci_validation.py- Dry-run validationexamples/use_cases/ci_regression_test.py- Regression gate for CI- Sample GitHub Actions workflow in docs
- Find the topic in the Quick Reference table above
- Navigate to the listed example file
- Read the directory README and the file for usage
- Run the example with
python examples/<category>/<file>.py
- Read the example's source (first 10-20 lines)
- Check this mapping to find related documentation
- Read the docs for conceptual background
- Return to the example with better understanding
- Update this mapping when adding new examples
- Ensure docs reference actual example files (not inline code only)
- Keep inline docs snippets minimal; link to full examples
- See
examples/CONTRIBUTING.mdfor guidelines
When adding new examples:
- Add entry to the appropriate section above
- Update Quick Reference table
- Link from relevant documentation pages
When adding new docs:
- Reference existing examples where applicable
- Add mapping entries if introducing new concepts
- Prefer linking to examples over long inline code blocks
Philosophy:
- Documentation = explains concepts with minimal code
- Examples = demonstrates usage with complete, runnable code
- This file = bridges the gap between the two
- examples/README.md - Overview of all examples
- examples/CONTRIBUTING.md - Guidelines for adding examples
- docs/usage/examples-directory.md - Documentation hub
- docs/usage/examples.md - Inline documentation snippets