This demo showcases the framework-backed workflow for testing database engines for Substrait compliance and publishing results to an interactive dashboard.
Status: pre-release demo surface. This demo is intended for local evaluation, contributor walkthroughs, and documentation support. It should not be presented as a benchmark, certification program, or production monitoring system.
- Quick Start (5 Minutes)
- Demo Overview
- Dashboard Features
- Demo Components
- Usage Scenarios
- Mock Engine Characteristics
- Function Tests
- Customization
- Troubleshooting
- Next Steps
This demo is intended for:
- local walkthroughs of the framework-backed execution flow
- deterministic sample report generation
- dashboard UX evaluation
- contributor documentation and experimentation
This demo is not intended to serve as:
- an official certification result for any engine
- a substitute for production observability or SLO monitoring
- a statistically rigorous benchmark harness
- a guarantee of real engine behavior outside the deterministic demo adapters in
demo/engines
- ✅ Java 17 or higher
- ✅ Python 3.8+ (for web server and function tests)
- ✅ Web browser
# From repository root
sdk/java/gradlew shadowJar -p sdk/java# Navigate to demo directory
cd demo
# Run the TPC-H demo script (22 queries, ~1-2 minutes)
./runner/run-simple-demo.sh# Run the Python function test suite (5,000+ tests, ~5-10 minutes)
cd runner
./run-function-tests-python.shExpected output:
📦 Loading TPC-H test suite...
✅ Loaded test suite: tpch
Total test cases: 22
🔧 Testing: MockDB v1.0.0
Total Tests: 22 ✅ Passed: 22 ❌ Failed: 0 ⏭️ Skipped: 0
📊 Pass Rate: 100.0%
🔧 Testing: FastDB v2.5.0
Total Tests: 22 ✅ Passed: 21 ❌ Failed: 1 ⏭️ Skipped: 0
📊 Pass Rate: 95.5%
🔧 Testing: CloudDB v3.1.0
Total Tests: 22 ✅ Passed: 17 ❌ Failed: 5 ⏭️ Skipped: 0
📊 Pass Rate: 77.3%
🔧 Testing: DuckDB v0.10.0
Total Tests: 22 ✅ Passed: 14 ❌ Failed: 0 ⏭️ Skipped: 8
📊 Pass Rate: 63.6%
🔧 Testing: PostgreSQL v16.0
Total Tests: 22 ✅ Passed: 14 ❌ Failed: 0 ⏭️ Skipped: 8
📊 Pass Rate: 63.6%
🥇 MockDB 1.0.0 100.0% 🟢 VERIFIED
🥈 FastDB 2.5.0 95.5% 🟢 VERIFIED
🥉 CloudDB 3.1.0 77.3% 🔵 EDGE
🥉 DuckDB 0.10.0 63.6% 🟡 BASIC
🥉 PostgreSQL 16.0 63.6% 🟡 BASIC
✅ Demo completed successfully!
# Check that reports were generated
ls -la runner/output/
# Should show: *_function_tests.json and *_tpcds_report.json files
# Check that dashboard data was created
ls -la dashboard/data/
# Should show: leaderboard.json and summary.json# Navigate to dashboard directory
cd dashboard
# Start Python web server
python3 -m http.server 8080If port 8080 is in use, try:
python3 -m http.server 8081
# or
python3 -m http.server 9000Open your web browser and go to:
http://localhost:8080
The demo runs five deterministic simulated demo engines (MockDB, FastDB, CloudDB, DuckDB, and PostgreSQL) against the framework-backed TPC-H suite and publishes the generated results to a web dashboard.
All five engines in this directory are demo adapters with deterministic behavior. They are useful for validating the framework flow and dashboard rendering, but they are not evidence of certified behavior for upstream database products.
- Header: Shows the participating engines and aggregate pass-rate metrics
- Leaderboard Table: Rankings with 🥇🥈🥉 medals
- Bar Chart: Pass rate comparison
- Doughnut Chart: Test distribution
- Detail Cards: Per-engine breakdowns
🥇 MockDB 100.0% 🟢 VERIFIED — returns expected output verbatim
🥈 FastDB 95.5% 🟢 VERIFIED — one numeric value off in q01
🥉 CloudDB 77.3% 🔵 EDGE — last row dropped in 5 queries
🥉 DuckDB 63.6% 🟡 BASIC — 8 complex plans unsupported
🥉 PostgreSQL 63.6% 🟡 BASIC — different 8 plans unsupported
-
Demo Engines Execute Tests
- Loads the TPC-H YAML suite and associated plan/data files
- Executes 22 Substrait query plans through the Java compliance framework
- Produces deterministic compliance report JSON for each engine
-
Reports Aggregation
- Collects all engine reports
- Calculates rankings
- Generates leaderboard markdown and JSON
-
Dashboard Display
- Shows rankings and statistics
- Provides interactive visualizations
- Enables query-level drill-down
If you want to adapt this demo for a public showcase, staging environment, or downstream distribution, validate the following first:
- replace demo adapters with real engine integrations or clearly label them as simulated
- verify generated reports against the packaged framework artifacts you intend to distribute
- confirm dashboard hosting, caching, and refresh behavior in your target environment
- document data provenance for every displayed result
- define who owns support for demo failures, stale data, and broken visualizations
- Real-time Rankings: Engines ranked by pass rate
- Key Metrics: Pass rate, tests passed/failed/skipped
- Status Indicators: Visual badges (VERIFIED 🟢, EDGE 🔵, BASIC 🟡, NONE 🔴)
- Interactive Rows: Click any engine row to view detailed results
Click on any engine in the leaderboard to open a detailed modal showing:
- Summary Statistics: Pass rate, passed/failed/skipped counts, average execution time
- Individual Query Results: Each TPC-H query displayed as a card with:
- Query name (Q01-Q22)
- Complexity badge (Simple, Medium, Complex, Very Complex)
- Status (Passed/Failed/Skipped)
- Execution time in milliseconds
- Error messages (for failed tests)
How to Use:
- Click any engine row in the leaderboard table
- Modal opens with detailed query-by-query results
- Scroll through query cards to see individual results
- Click the X or outside the modal to close
Filter results to focus on specific query complexity levels:
- All Queries (default): Shows all 22 TPC-H queries
- Simple: 3 queries (Q1, Q6, Q14) - Basic aggregations
- Medium: 7 queries (Q3, Q4, Q10, Q12, Q13, Q16, Q19) - Joins and filters
- Complex: 8 queries (Q5, Q7, Q9, Q11, Q15, Q17, Q18, Q22) - Multi-table joins
- Very Complex: 4 queries (Q2, Q8, Q20, Q21) - Subqueries and advanced operations
How to Use:
- Use the dropdown in the leaderboard section header
- Select a complexity level
- Click any engine to see filtered results in the modal
- Modal shows only queries matching the selected complexity
- Summary statistics update to reflect filtered queries only
- Pass Rate Comparison: Bar chart comparing engine pass rates
- Test Distribution: Doughnut chart showing tests passed per engine
- Color-coded Performance: Green (95%+), Yellow (85-94%), Orange (70-84%), Red (<70%)
- Dashboard automatically refreshes every 30 seconds
- Ensures latest test results are always displayed
- No manual refresh needed
demo/
├── README.md # This file
├── engines/ # Mock database engines
│ ├── MockDBEngine.java # Mock database implementation
│ ├── FastDBEngine.java # Fast database implementation
│ ├── CloudDBEngine.java # Cloud database implementation
│ ├── DuckDBEngine.java # DuckDB demo implementation
│ └── PostgreSQLEngine.java # PostgreSQL demo implementation
├── runner/ # Demo execution scripts
│ ├── DemoRunner.java # Main demo runner
│ ├── EnhancedDemoRunner.java # Integrated end-to-end demo runner
│ ├── FunctionTestDemo.java # Functional test demo runner
│ ├── run-demo.sh # Basic demo runner script
│ ├── run-enhanced-demo.sh # Integrated TPC-H + function dashboard demo
│ ├── run-simple-demo.sh # Simplified demo (recommended)
│ └── run-function-tests.sh # Functional test runner
├── dashboard/ # Web dashboard
│ ├── index.html # Dashboard UI
│ ├── styles.css # Dashboard styles
│ ├── dashboard.js # Dashboard logic
│ └── data/ # Generated reports
│ └── .gitkeep
└── output/ # Demo output
└── .gitkeep
Goal: Get a high-level view of engine compliance
- Run demo:
./runner/run-simple-demo.sh - Open dashboard
- Review leaderboard rankings
- Check pass rate chart
Expected Result: A deterministic leaderboard is generated from the current demo adapters and written to the dashboard data directory.
Goal: Understand why an engine is failing tests
- Open dashboard
- Click on CloudDB (lowest pass rate)
- Scroll through query cards
- Identify failed queries (red border)
- Read error messages
Expected Result: See which specific queries failed and why in the generated demo report set.
Goal: Determine if an engine handles complex queries well
- Open dashboard
- Select "Simple" from complexity filter
- Click FastDB → Note pass rate for simple queries
- Select "Very Complex" from filter
- Click FastDB again → Compare pass rate
Expected Result: Compare how the deterministic demo adapters present different complexity buckets in the dashboard.
Goal: Find the fastest engine for specific query types
- Open dashboard
- Select "Medium" complexity
- Click each engine and note average execution times
- Compare times across engines
Expected Result: Compare the demo adapters' reported execution-time estimates in the generated dashboard output.
Each engine subclasses DemoEngineBase, which loads the 22 TPC-H expected CSVs
on initialize() and caches them by plan hash. executePlan() looks up the
correct expected output and applies the engine's specific failure pattern.
- Behaviour: Returns the expected output verbatim for every query.
- Demonstrates: What a fully-compliant engine looks like end-to-end.
- Support boundary: Demo adapter — not a real product integration.
- Behaviour: Correct on all queries except q01, where
sum_qtyin row 0 is shifted by +1.0 (380457.0instead of380456.0). - Demonstrates: The comparator catching a floating-point aggregation bug (epsilon threshold is 1e-9; a difference of 1.0 fails).
- Support boundary: Demo adapter — not a real product integration.
- Behaviour: Correct on 17 queries; for q08, q11, q14, q17, q19 the last row of the result is silently dropped.
- Demonstrates: Row-count mismatch detection (off-by-one truncation bug).
- Support boundary: Demo adapter — not a real product integration.
- Behaviour: Returns
PlanValidationResult.unsupported()for q02, q08, q11, q15, q17, q20, q21, q22 — the runner marks these SKIPPED. - Demonstrates: Partial support via
validatePlan()— engine correctly declines plans it cannot handle rather than returning wrong results. - Support boundary: Demo adapter — not an official upstream certification result.
- Behaviour: Same mechanics as DuckDB but rejects a different set of 8 queries (q07, q09, q13, q16, q18, q19, q20, q21).
- Demonstrates: Two engines can have the same pass rate with different coverage gaps, visible in the query-level drill-down.
- Support boundary: Demo adapter — not an official upstream certification result.
The demo includes comprehensive function-level compliance tests across 7 major categories:
-
Advanced Math Functions (11 tests)
- round, ceil, floor, trunc, log, log10, ln, sign, mod, radians, degrees
-
Array/List Functions (6 tests)
- array_construct, array_element, array_length, array_concat, array_contains, array_position
-
Struct/Map Functions (5 tests)
- struct_construct, struct_extract, map_construct, map_extract, map_keys
-
JSON Functions (2 tests)
- json_extract, json_parse
-
Conditional Functions (2 tests)
- case_when, if_then_else
-
Set Operations (3 tests)
- union, intersect, except
-
Geospatial Functions (4 tests)
- st_distance, st_contains, st_intersects, st_area
cd demo/runner
./run-function-tests-python.shThis will:
- Execute tests for all function categories
- Generate JSON reports in
demo/output/ - Create a summary report
- Display results in a formatted table
Create a new engine class:
public class YourDBEngine implements ComplianceEngine {
@Override
public EngineInfo getEngineInfo() {
return new EngineInfo("YourDB", "1.0.0", "0.20.0");
}
@Override
public ComplianceResult executePlan(Plan plan, Map<String, TableData> inputData) {
// Your implementation
}
// ... other methods
}Add to DemoRunner.java:
engines.add(new YourDBEngine());Modify the demo engine implementations to change deterministic output shaping or execution-time estimation.
Update DemoRunner.java to use different test suites:
TestSuite suite = loader.load("path/to/your/suite.yaml");Edit demo/dashboard/styles.css:
.modal-content: Modal size and positioning.query-card: Individual query card styling.complexity-*: Complexity badge colors
Problem: Dashboard shows "Failed to load leaderboard data"
Solution:
# Ensure demo has been run
./runner/run-simple-demo.sh
# Check if data file exists
ls -la dashboard/data/leaderboard.json
# Use web server instead of file://
cd dashboard && python3 -m http.server 8080Problem: Clicking engine row does nothing
Solution:
- Open browser console (F12)
- Look for errors like "Failed to load report"
- Verify files exist:
ls demo/output/*.json - Check file names match:
mockdb-report.json,fastdb-report.json,clouddb-report.json - Re-run demo:
./runner/run-simple-demo.sh
Problem: Dropdown changes but modal shows all queries
Solution:
- Check browser console for JavaScript errors
- Verify
onchange="filterByComplexity(this.value)"in HTML - Hard refresh browser (Ctrl+Shift+R or Cmd+Shift+R)
Problem: "Address already in use" error
Solution:
# Use a different port
python3 -m http.server 8081
# or
python3 -m http.server 9000Problem: Cannot execute run-simple-demo.sh
Solution:
chmod +x runner/run-simple-demo.sh
./runner/run-simple-demo.shProblem: Empty chart areas
Solution:
- Check internet connection (Chart.js loads from CDN)
- Verify JavaScript is enabled
- Try different browser
- Check browser console for CDN errors
Problem: Java compilation fails
Solution:
# The demo script builds the SDK automatically, but you can rebuild manually:
cd ../sdk/java
./gradlew clean shadowJar
cd ../../demo
./runner/run-simple-demo.shProblem: error: cannot find symbol … DemoEngineBase
Solution: Make sure engines/DemoEngineBase.java is in the javac source
list in runner/run-simple-demo.sh. The script already includes it — if you
have a local edit that removed it, restore that line.
Problem: Output directory is empty
Solution:
# Check output directory permissions
chmod -R 755 demo/output
# Re-run demo
./runner/run-simple-demo.shAfter running the framework-backed demo:
demo/output/
├── analytics/analytics-report.json # Analytics summary
├── storage/ # Private/public report storage
├── mockdb-report.json # MockDB TPC-H report
├── fastdb-report.json # FastDB TPC-H report
├── clouddb-report.json # CloudDB TPC-H report
├── duckdb-report.json # DuckDB TPC-H report
├── postgresql-report.json # PostgreSQL TPC-H report
└── function_tests_summary.json # Functional test summary
demo/dashboard/data/
├── leaderboard.json # TPC-H dashboard leaderboard
└── summary.json # Cross-suite dashboard summary
- ✅ Run the demo:
./runner/run-simple-demo.sh - ✅ View dashboard: Open
http://localhost:8080 - ✅ Explore reports:
cat output/*.json - ✅ Present to stakeholders
- Replace demo engines with real engine integrations
- Connect execution to actual databases or query runtimes
- Deploy dashboard to a hosted web server
- Set up CI/CD for automated testing
- Extend report publication and storage workflows
- Review Code:
demo/engines/DemoEngineBase.java+ the five subclasses - Modify Engines: Change which queries fail and how (perturb values, drop rows, mark unsupported)
- Customize Dashboard: Update
demo/dashboard/styles.cssandindex.html - Real Integration: Implement
ComplianceEnginewith your actual query runtime and replace the demo adapters
For questions or issues:
- Review main project README:
../README.md - Check SDK documentation:
../sdk/*/README.md - See examples:
../examples/README.md - Check browser console for errors (F12)
- Verify all files generated correctly
- Simulates realistic query execution times (50-500ms)
- Generates deterministic pass/fail patterns
- Creates valid TableData structures
{
"engineName": "MockDB",
"engineVersion": "1.0.0",
"substraitVersion": "0.20.0",
"timestamp": "2026-04-15T22:50:00Z",
"testSuiteName": "TPC-H",
"totalTests": 22,
"passed": 19,
"failed": 2,
"skipped": 1,
"passRate": 86.4,
"testResults": [...]
}- Pure HTML/CSS/JavaScript (no frameworks)
- Chart.js for visualizations
- Responsive design
- Works offline (after initial load)
- Modern browser with JavaScript enabled
- Chart.js library (loaded via CDN)
- Local web server (due to CORS restrictions)
Demo Purpose: Educational demonstration of the Substrait Compliance Framework workflow. Mock engines simulate real database behavior for testing and visualization purposes.
Last Updated: 2026-05-30