Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 38 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -213,24 +213,24 @@ sqlbuild-scopes = { path = "crates/sqlbuild-scopes" }
sqlbuild-sqltext = { path = "crates/sqlbuild-sqltext" }
sqlbuild-state = { path = "crates/sqlbuild-state" }
# SQL lint Rules, quality Rules and the formatter.
sqlclean = { git = "https://github.com/sqlstack-io/sqlclean.git", rev = "8550e6a45c95a4a9e8470a570ae786d6f0deee8e" }
sqlclean = { git = "https://github.com/sqlstack-io/sqlclean.git", rev = "462a98779a2a11ff11884ff79feefbfb190ab8d1" }
# SQL change fingerprints over SQLQuack's tokenizers.
sqlquack-fingerprint = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174", features = ["bigquery", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
sqlquack-fingerprint = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d", features = ["bigquery", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
# Scopes, name resolution, types and lineage for the native analysis route.
sqlquack-semantics = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174", features = ["bigquery", "clickhouse", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
sqlquack-semantics = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d", features = ["bigquery", "clickhouse", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
# SQLQuack's Snowflake-family parser and tokenizer, reached as SQLQuack exposes them.
sqlquack-parse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
sqlquack-parse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
# SQLQuack's syntax tree and lossless tokens.
sqlquack-syntax = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
sqlquack-syntax = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
# SQLQuack's tokenizer: lossless tokens and tokenize failures.
sqlquack-tokenize = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
sqlquack-syntax-bigquery = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
sqlquack-syntax-clickhouse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
sqlquack-syntax-databricks = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
sqlquack-syntax-duckdb = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
sqlquack-syntax-postgres = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
sqlquack-syntax-sqlite = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
sqlquack-syntax-sqlserver = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
sqlquack-tokenize = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
sqlquack-syntax-bigquery = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
sqlquack-syntax-clickhouse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
sqlquack-syntax-databricks = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
sqlquack-syntax-duckdb = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
sqlquack-syntax-postgres = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
sqlquack-syntax-sqlite = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
sqlquack-syntax-sqlserver = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "083ccc7121a43a3c471d646ef45845ce3ea69d6d" }
stacker = "0.1"
# Counts heap allocations in growth tests, which measure work instead of time.
stats_alloc = "0.1"
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ E2E_DUCKDB_BUILD_INCREMENTAL_PATHS := \
tests/e2e/src/sqlbuild/cli/commands/main/build/test_capped_microbatch_build.py \
tests/e2e/src/sqlbuild/cli/commands/main/build/test_changed_builds.py \
tests/e2e/src/sqlbuild/cli/commands/main/build/test_concurrent_microbatch_build.py \
tests/e2e/src/sqlbuild/cli/commands/main/build/test_cursor_window_floors.py \
tests/e2e/src/sqlbuild/cli/commands/main/build/test_cursor_observations.py \
tests/e2e/src/sqlbuild/cli/commands/main/build/test_cursor_runtime_failures.py \
tests/e2e/src/sqlbuild/cli/commands/main/build/test_dropped_relation_rebuild.py \
Expand Down
8 changes: 5 additions & 3 deletions benchmarks/duckshop-10k/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ iteration. `checksum.txt` records the full profile only.

The generator uses no randomness, clocks or environment: the same generator version always writes
byte-identical files. `checksum.txt` holds the generator version, the file count and the SHA-256 of
`MANIFEST.sha256`, a sorted list of the SHA-256 of every generated file.
`MANIFEST.sha256`, a sorted list of the SHA-256 of every generated file. The generator writes it to
`target/MANIFEST.sha256` in the generated project, beside SQLBuild's local build output, so the
project root holds only project files.

When a change alters any generated file, bump `GENERATOR_VERSION` in `duckshop10k/__init__.py` and
run `python benchmarks/duckshop-10k/generate.py --update-checksum`.
Expand All @@ -38,7 +40,7 @@ run `python benchmarks/duckshop-10k/generate.py --update-checksum`.
| Models | 10,840 |
| Staging, intermediate, marts and snapshots | 6,149 (56.7%), 2,519 (23.2%), 2,162 (19.9%), 10 |
| Incremental models | 583, 112 of them with a capped automatic start and 112 renamed |
| Python export assets | 433 in 241 modules sharing one helper module |
| Python export assets | 433, each in its own `asset.py`, sharing one helper module |
| Sources | 2,466 table sources and one expression source |
| Unit tests and scenarios | 288 and 2 |
| Dependency depth | 11 at most; 170 models at depth 7 or more |
Expand All @@ -57,7 +59,7 @@ A large project also carries planning workload the layers above barely touch, so
it in the proportions such projects have: an incrementally kept history of every third timestamped
intermediate table, one in five of them capping how far ahead its automatic start may sit and one in
five renamed from an older name with `migrate_from`, and a Python export asset for every fifth
published mart, a few per module, all sharing one helper module. A live plan reads a cursor bound for
published mart, each in its own `asset.py`, all sharing one helper module. A live plan reads a cursor bound for
each incremental model, plans each rename and discovers each Python node.

The models that use `HASH`, `TIMESTAMP_LTZ` or `CURRENT_TIMESTAMP()` are tagged `known_divergence`,
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/duckshop-10k/checksum.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
generator 4 files 11674 sha256 c3a3d8f62a23c4ae770c70ceb5437d849bb32211edb12b6017af25a76fb8d7e2
generator 5 files 11866 sha256 d0b3847b68e1aac09af58422d804badc23d8a880607bb8e2bce2efb11ba1ae6c
2 changes: 1 addition & 1 deletion benchmarks/duckshop-10k/duckshop10k/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
regenerate checksum.txt, whenever a change alters any generated file.
"""

GENERATOR_VERSION = "4"
GENERATOR_VERSION = "5"
SEED = 20261024
PROJECT_NAME = "duckshop_10k"
12 changes: 7 additions & 5 deletions benchmarks/duckshop-10k/duckshop10k/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

from duckshop10k import GENERATOR_VERSION

MANIFEST_NAME = "MANIFEST.sha256"
# Under the project's local build output, so the project root holds only SQLBuild project files.
MANIFEST_PATH = "target/MANIFEST.sha256"


def manifest(files: dict[str, str]) -> str:
Expand Down Expand Up @@ -36,16 +37,17 @@ def write_project(files: dict[str, str], out: Path) -> None:
target = out / path
target.parent.mkdir(parents=True, exist_ok=True)
target.write_bytes(content.encode("utf-8"))
(out / MANIFEST_NAME).write_bytes(manifest(files).encode("utf-8"))
manifest_file = out / MANIFEST_PATH
manifest_file.parent.mkdir(parents=True, exist_ok=True)
manifest_file.write_bytes(manifest(files).encode("utf-8"))


def read_project(out: Path) -> dict[str, str]:
"""Every generated file below `out`, skipping the manifest and local build output."""
skipped = {MANIFEST_NAME}
"""Every generated file below `out`, skipping local build output, which holds the manifest."""
local = ("target/", "logs/", ".sqlbuild/", "sqlbuild_local.toml")
files: dict[str, str] = {}
for path in sorted(out.rglob("*")):
relative = path.relative_to(out).as_posix()
if path.is_file() and relative not in skipped and not relative.startswith(local):
if path.is_file() and not relative.startswith(local):
files[relative] = path.read_bytes().decode("utf-8")
return files
Loading
Loading