with one click
run-tests
Build and run LPTS test suite (or a specific test file).
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Build and run LPTS test suite (or a specific test file).
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Reference for LPTS DDL syntax — PRAGMA lpts, lpts_query, the lpts_check round-trip setting, lpts_normalize_query, dialect settings, and print_ast. Auto-loaded when discussing LPTS usage, pragmas, table functions, round-trip checks, or dialect configuration.
Style guide for writing LPTS documentation. Auto-loaded when writing, editing, or reviewing docs, README, user guides, or SQL reference pages. Blends Snowflake's structured clarity with DuckDB's concise, example-first approach.
Comprehensive reference for the LPTS pipeline — LogicalPlan to AST to CTE List to SQL string. Covers AST node hierarchy, CTE node hierarchy, column binding maps, expression resolution, and operator-specific conversion logic. Auto-loaded when discussing the pipeline, AST nodes, CTE generation, or operator handling.
| name | run-tests |
| description | Build and run LPTS test suite (or a specific test file). |
GEN=ninja make 2>&1 | tail -5make unittest 2>&1
build/release/test/unittest "test/sql/<test_name>.test" 2>&1| Test file | Operators covered |
|---|---|
test/sql/select.test | GET, FILTER, PROJECTION |
test/sql/group_by.test | GET, PROJECTION, AGGREGATE |
test/sql/having.test | AGGREGATE + FILTER (HAVING) |
test/sql/join.test | GET, PROJECTION, JOIN, UNION |
test/sql/union.test | UNION / UNION ALL |
test/sql/order_limit.test | ORDER BY, LIMIT, OFFSET |
test/sql/distinct.test | SELECT DISTINCT |
test/sql/functions.test | Scalar functions, casts |
test/sql/lambda.test | Lambda expressions |
test/sql/cast.test | CAST expressions |
test/sql/print_ast.test | AST ToString() output |
test/sql/check_mode.test | lpts_check round-trip correctness (canonical example) |
test/sql/pragmas.test | Public function metadata (5 functions) |
SET lpts_check = true — Primary correctness mechanism. Set once after require lpts, then run queries directly; every top-level SELECT is transparently compared against its LPTS rewrite and raises on a mismatch. Use a bare SELECT ...; in a query block to also assert rows, or statement ok when no row assertion is needed. A wrong rewrite is a statement error whose text contains LPTS check failed. Every test must turn this on.lpts_query('query') — Returns the generated SQL string. Use to assert exact SQL structure, or for input-dialect tests that cannot run as bare DuckDB statements (SELECT sql FROM lpts_query('...')).TPC-H tests require the tpch extension. Structure:
require lpts
require tpch
statement ok
SET lpts_check = true;
statement ok
CALL dbgen(sf=0.01);
statement ok
<tpch_query>;
The SQL-Storm-queries/ directory contains 1000 complex queries over TPC-H tables.
Select representative samples that exercise different operator combinations.
Turn on lpts_check and run each query directly to verify correctness.
Unsupported operators will throw NotImplementedException (expected during
incremental development).
#define LPTS_DEBUG 1 in src/include/lpts_debug.hpp for verbose pipeline tracePRAGMA lpts('...') in make shell to see the generated SQLPRAGMA print_ast('...') to visualize the AST treeEXPLAIN <query> to inspect DuckDB's logical planLPTS_DEBUG back to 0 before committing