feat: SQL Server 2025 support (plus as_columnstore docs and a store-failures regression test)#728
feat: SQL Server 2025 support (plus as_columnstore docs and a store-failures regression test)#728joshmarkovic wants to merge 8 commits into
Conversation
Cover SQL Server 2025 in the integration-test matrix (pyodbc and mssql-python on Python 3.13 / ODBC Driver 18) and add it to the published server CI images. Rename the server Dockerfile build arg SQLServer_VERSION to MSSQL_VERSION to match the build-arg the workflow already passes; with the old name the matrix version was ignored and every image used the 2022 default. Document 2025 as a supported version and refresh the stale dbt-core 0.14 compatibility note to 1.10.
Explain that table materializations build a clustered columnstore index by default, and that as_columnstore: false is required for tables with (n)varchar(max)/LOB columns such as dbt store_failures audit tables.
) A passing test run with --store-failures must replace prior failures with an empty audit table rather than drop it. Adds a functional regression test for dbt-msft#601.
for more information, see https://pre-commit.ci
Co-authored-by: Axell Padilla <68310020+axellpadilla@users.noreply.github.com>
Addresses @axellpadilla's review on dbt-msft#721. - integration tests: make 2025 the matrix baseline, replacing 2022 as the latest tier. Keep 2017, 2019 and 2022 as single legacy rows so all four versions stay covered by CI. - README: remove the duplicate "Supported SQL Server versions" heading and the Azure SQL Database / Managed Instance rows that were marked tested. Azure is now described as not covered by CI but expected to be compatible.
The index feature emits OPTIMIZE_FOR_SEQUENTIAL_KEY and RESUMABLE (plus RESUMABLE's MAX_DURATION) unconditionally. These are only recognized on SQL Server 2019 (major 15)+, so on a genuine 2017 engine the CREATE INDEX fails with "is not a recognized CREATE INDEX option" (msg 155). This was masked until now: the server-2017/2019/2022 CI images were all built FROM ...:2022-latest because publish-docker passed build-arg MSSQL_VERSION while server.Dockerfile declared SQLServer_VERSION. This PR fixes that arg name, so the 2017 leg finally runs real 2017 and exposed the incompatibility. We support 2017 (Microsoft still does), so detect the engine major version and, when < 15, drop these options (with a warning) and build the index without them instead of failing. ONLINE is kept (recognized on 2017, edition-gated not version-gated). Behavior on 2019+ is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The only failing job was the SQL Server 2017 leg, and it was exposed (not caused) by this PR. Root cause: before this PR, Proof that the old "2017" tests ran on a 2022 engine: master's most recent On a real 2017 engine, two existing index tests failed because the create-index macro emitted options that only SQL Server 2019+ recognizes:
Fix (pushed): we support 2017 (Microsoft still does), so I gated those options on the detected engine major version. On versions below 2019 ( @axellpadilla flagging for visibility. |
Summary
This branch bundles three independent changes. Happy to split into separate PRs if that is easier to review.
1. SQL Server 2025 support (
703862b)server.Dockerfilebuild argSQLServer_VERSIONtoMSSQL_VERSIONso it matches the build-arg the workflow already passes. With the old name the matrix value was ignored and everyserver-*image was built from the2022default, so the 2017/2019 (and now 2025) images were silently all 2022.2. Document the
as_columnstoreconfig (391080c, refs #440)The
as_columnstoreconfig (defaulttrue, which builds a clustered columnstore index) was undocumented. This adds a README section, including the workaround for test failure storage: audit tables can contain(n)varchar(max)columns, which SQL Server does not allow in a columnstore index, soas_columnstore: falseon those resources avoids the build error.3. Regression test for store-failures on passing tests (
7d8e90b, refs #601)A passing test run with
--store-failuresshould leave an empty audit table, not drop it (the documented dbt behavior, and what Postgres does). This adds a functional test asserting the audit relation persists as an empty user table across idempotent re-runs.This closes a coverage gap: the existing
test_store_test_failures.pysuite only asserted the passing case for view-based store-failures, never the table-based case from #601.Verified locally against SQL Server 2022 with a case-sensitive collation: the new test passes, and the existing 6-test store-failures suite still passes. The reported behavior no longer reproduces on current
master, so the test serves as a regression guard.