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
1 change: 1 addition & 0 deletions .github/actions/setup-uv/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ runs:
sidemantic-rs/Cargo.toml
sidemantic-rs/build.rs
sidemantic-rs/src/**
sidemantic-rs/schemas/**
crates/*/Cargo.toml
crates/*/src/**
crates/dax-pyo3/python/**/*.py
Expand Down
32 changes: 28 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,17 +315,38 @@ jobs:
rust-key: ${{ steps.rust-cache.outputs.key }}
uv-key: ${{ steps.uv.outputs.cache-key }}

update-schema:
name: Update JSON Schema
schema-pr-state:
name: Check schema update eligibility
needs: python
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
eligible: ${{ steps.state.outputs.result }}
steps:
- uses: actions/github-script@v7
id: state
with:
script: |
const {data: pr} = await github.rest.pulls.get({
...context.repo, pull_number: context.issue.number
});
return pr.state === 'open'
&& pr.head.sha === context.payload.pull_request.head.sha
&& pr.head.repo.full_name === context.payload.repository.full_name;

update-schema:
name: Update JSON Schema
needs: schema-pr-state
if: needs.schema-pr-state.outputs.eligible == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
ref: ${{ github.event.pull_request.head.sha }}

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
Expand All @@ -350,14 +371,17 @@ jobs:
run: uv sync --extra dev --extra dax

- name: Generate and commit schema if needed
env:
PR_BRANCH: ${{ github.head_ref }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
uv run python scripts/generate_schema.py
if ! git diff --exit-code sidemantic-schema.json; then
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add sidemantic-schema.json
git commit -m "Auto-update JSON schema"
git push
git push --force-with-lease="refs/heads/$PR_BRANCH:$PR_HEAD_SHA" origin "HEAD:refs/heads/$PR_BRANCH"
fi

- name: Save completed build caches
Expand Down
58 changes: 56 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ jobs:
uv run pytest --test-engine python -m integration tests/db/test_postgres_cli_e2e.py -v
uv run pytest --test-engine rust -m integration tests/db/test_postgres_cli_e2e.py -v

# The suite parametrizes Python, public Rust (no fallback), and native Rust import/compile.
- name: Run Ossie on real PostgreSQL and DuckDB
env:
POSTGRES_URL: "postgres://test:test@localhost:5432/sidemantic_test"
run: |
OSSIE_INTEGRATION_BACKEND=duckdb uv run pytest -m integration tests/db/test_ossie_integration.py -v
OSSIE_INTEGRATION_BACKEND=postgres uv run pytest -m integration tests/db/test_ossie_integration.py -v

- name: Save completed build caches
if: ${{ !cancelled() }}
uses: ./.github/actions/save-build-caches
Expand Down Expand Up @@ -109,8 +117,15 @@ jobs:
ghcr.io/goccy/bigquery-emulator:0.8.1 \
--project=test-project --dataset=test_dataset

# Wait for emulator to be ready
sleep 5
# Require a responding emulator before executing database assertions.
for attempt in {1..30}; do
if curl --fail --silent http://localhost:9050/bigquery/v2/projects/test-project/datasets > /dev/null; then
exit 0
fi
sleep 1
done
docker logs bigquery-emulator
exit 1

- name: Install uv
id: uv
Expand All @@ -135,6 +150,28 @@ jobs:
uv run pytest --test-engine python -m integration tests/db/test_bigquery_integration.py -v
uv run pytest --test-engine rust -m integration tests/db/test_bigquery_integration.py -v

# The suite parametrizes Python, public Rust (no fallback), and native Rust import/compile.
- name: Run Ossie on BigQuery emulator (not live cloud)
env:
OSSIE_INTEGRATION_BACKEND: "bigquery"
BIGQUERY_EMULATOR_HOST: "localhost:9050"
BIGQUERY_PROJECT: "test-project"
BIGQUERY_DATASET: "test_dataset"
run: |
# The emulator retains a bounded WASM heap. Isolate each compiler
# route from earlier suites without skipping any route's SQL assertions.
for ossie_route in python public_rust native_rust; do
docker restart bigquery-emulator
for attempt in {1..30}; do
if curl --fail --silent http://localhost:9050/bigquery/v2/projects/test-project/datasets > /dev/null; then
break
fi
sleep 1
done
curl --fail --silent http://localhost:9050/bigquery/v2/projects/test-project/datasets > /dev/null
uv run pytest -m integration tests/db/test_ossie_integration.py -k "$ossie_route" -v
done

- name: Save completed build caches
if: ${{ !cancelled() }}
uses: ./.github/actions/save-build-caches
Expand Down Expand Up @@ -179,6 +216,13 @@ jobs:
uv run --with "fakesnow==0.11.11" pytest --test-engine python -m integration tests/db/test_snowflake_integration.py -v
uv run --with "fakesnow==0.11.11" pytest --test-engine rust -m integration tests/db/test_snowflake_integration.py -v

# The suite parametrizes Python, public Rust (no fallback), and native Rust import/compile.
- name: Run Ossie on fakesnow emulator (not live Snowflake)
env:
OSSIE_INTEGRATION_BACKEND: "snowflake"
run: |
uv run --with "fakesnow==0.11.11" pytest -m integration tests/db/test_ossie_integration.py -v

- name: Save completed build caches
if: ${{ !cancelled() }}
uses: ./.github/actions/save-build-caches
Expand Down Expand Up @@ -240,6 +284,16 @@ jobs:
uv run pytest --test-engine python -m integration tests/db/test_clickhouse_integration.py -v
uv run pytest --test-engine rust -m integration tests/db/test_clickhouse_integration.py -v

# The suite parametrizes Python, public Rust (no fallback), and native Rust import/compile.
- name: Run Ossie on real ClickHouse
env:
OSSIE_INTEGRATION_BACKEND: "clickhouse"
CLICKHOUSE_HOST: "localhost"
CLICKHOUSE_PORT: "8123"
CLICKHOUSE_PASSWORD: "clickhouse"
run: |
uv run pytest -m integration tests/db/test_ossie_integration.py -v

- name: Save completed build caches
if: ${{ !cancelled() }}
uses: ./.github/actions/save-build-caches
Expand Down
82 changes: 69 additions & 13 deletions docs/reviews/ossie-conformance-2026-11-05.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ follow-up scope is:
empty aggregate filter over nonempty and empty relations across both interfaces
and all three routes.
- Preserve unaggregated inline-window QUALIFY predicates before DISTINCT, ordering
and pagination, including aliases and CTE measure lineage. Unsupported grouped
or named-window QUALIFY shapes reject explicitly.
and pagination, including aliases and CTE measure lineage. Grouped and named
windows were initially rejected; the runtime follow-up below implements them.
- Bind view identities to catalog, schema and name; respect session search paths
and physical shadowing; keep discovery and cache invalidation consistent.

Expand Down Expand Up @@ -87,10 +87,64 @@ native policy tests pass, including intermediate and unselected model policies.

CI follow-ups regenerate the CLI manpage at each stage, support the minimum
SQLGlot version without requiring its newer AGG node class, and fix Rust Clippy
warnings. Native quoted wildcard RENAME operands now fail explicitly because the
pinned parser loses quote identity; other aliases and wildcard modifiers remain
supported. Regression tests cover ordinary physical SQL and quoted text/comments
to keep the rejection confined to semantic wildcard queries.
warnings. Native quoted wildcard RENAME operands initially failed explicitly
because the pinned parser lost quote identity; the runtime follow-up below
preserves that identity before parsing and supports these operands.

## Runtime and database follow-up

The follow-up closes the three previously reported limits:

- Grouped and named-window QUALIFY now supports inherited definitions, dynamic
frames, aggregate aliases, grouping sets, and hidden measure lineage. Aggregate
evaluation precedes windows; QUALIFY precedes DISTINCT, ordering, and pagination.
- Native wildcard RENAME preserves quoted names, dots, case, escaped quotes, and
Unicode. Qualified stars and stored view recipes retain the same identity.
- Native logical import evaluates all four immutable JSON Schemas offline and
reports `pinned_json_schema`. Both importers validate recognized SQL variants,
including unselected variants. Portable expressions use the portable source
parser, including its typed timestamp literals. Unknown vendor languages remain
opaque. Preservation/export and ontology/mapping operations remain in the shared
interchange API available with either public engine.

Real database execution found additional dialect problems that DuckDB-only checks
did not expose: materialized CTE syntax, PostgreSQL zero-row measure placeholders,
database-specific view name folding, ClickHouse view qualification and NULL/empty
aggregate defaults, native wide-query output aliases, and ClickHouse's restriction
on correlated aggregation over source identity windows. Grouped ClickHouse measures
now deduplicate and aggregate independently before joining their results to the
group domain. Query-local settings preserve standard NULL and join behavior.
The public Rust transport also retains explicit NULL ordering and lowers nested
QUALIFY for PostgreSQL. Snowflake named windows are resolved before dialect
normalization, and inactive BigQuery grouping-set keys retain their SQL types.
Native parsing accepts valid implicit `seed` aliases on derived source queries
without changing sampling clauses or quoted text.

The integration workflow explicitly runs the maintained Ossie suite on DuckDB,
PostgreSQL 16, ClickHouse 25.8, BigQuery emulator 0.8.1, and fakesnow 0.11.11.
Python, public Rust with fallback disabled, and native Rust import/compilation
execute emitted SQL directly. Expected results use physical SQL or explicit row
populations, including NULL/empty boundaries; compiler output is never transpiled
back to DuckDB as an execution shortcut. PostgreSQL and DuckDB also exercise the
CLI. BigQuery emulator view discovery and non-core CLI checks are explicitly outside
this suite's scope. A selected backend with missing dependencies or an unreachable
service fails the run.

The database matrix records 382 passing cases: 78 each on DuckDB and PostgreSQL,
76 each on ClickHouse and fakesnow, and 74 on the BigQuery emulator. The excluded
cases are the two core-only CLI checks on other targets and two BigQuery view
lifecycle checks. Each target runs Python, public Rust with fallback disabled,
and direct native Rust import/compilation. Filtered counts cover matched,
nonmatching, and empty populations, including DISTINCT and all-NULL inputs.

The follow-up also removes a native wide-query identity bug: independently
numbering a rescanned population could associate measures with the wrong group.
Measure inputs now travel with the deduplicated population. The original
ClickHouse reproducer returned incorrect values in 6 of 25 executions; the
corrected query passed all 25, with permanent permutation and duplicate-row
regressions. FILTER wrappers on ordinary Python window aggregates preserve row
cardinality. Filtered COUNT rendering is verified on SQLGlot 30.1, 30.12, and 30.23
to preserve DISTINCT, NULL, and empty-population semantics.

## Recorded pre-review verification

Expand Down Expand Up @@ -127,14 +181,16 @@ RUST_MIN_STACK=16777216 CARGO_BUILD_JOBS=2 \

## Coverage limits

Execution checks use DuckDB, including target-dialect SQL converted back for
execution. Live warehouse integration and the full unrelated repository suite
were not exercised. Native Rust remains a forward-import structural subset;
ontology and mapping preservation do not imply ontology reasoning or execution.
Unsupported security contexts fail closed.
The initial assessment used DuckDB, including target-dialect SQL converted back
for execution. The follow-up adds direct execution on the databases listed above.
BigQuery and Snowflake coverage uses emulators and does not establish live-cloud
behavior. Native logical schema validation does not imply native preservation or
export APIs; ontology and mapping preservation do not imply ontology reasoning or
execution. Unsupported security contexts fail closed.

The pinned specification's deferred features remain deferred, including measure
evaluation controls/windowing and unsupported Layer 3 path/filter shapes.
The pinned specification's deferred features remain deferred, including
measure-definition evaluation/window controls and unsupported Layer 3 path/filter
shapes. These are separate from the SQL window and QUALIFY support described above.
Passing the official validator does not prove all normative rules: it reports
some model-reference issues as warnings. The implementation combines pinned
upstream assets, official fixtures and independently authored runtime tests.
Expand Down
Loading
Loading