Repository navigation
feat(core-spec): decouple core spec from specific vendors - #617
christianeu-db merged 13 commits into
Conversation
3fbb2aa to
2885bd1
Compare
2885bd1 to
f60b217
Compare
Make the core specification vendor-neutral: - `Dialect` becomes a free-form string (was a closed enum), mirroring the already-free-form `Vendor`; generic schema `examples` replace concrete product names. - Move the known-dialect and known-vendor catalogs out of the normative spec into a new top-level `extensions/` folder (README, dialects.md, vendors.md), framed as a community registry whose listings do not imply endorsement. - Add an optional top-level portable `expression` field (OSSIE_SQL_2026) to the expression object; when both it and an OSSIE_SQL_2026 `dialects` entry are present, the top-level field is authoritative. Demonstrated on `customer_full_name` in examples/tpcds_semantic_model.yaml. - Keep the normative text that non-OSSIE dialects are opaque and declaration-only. Kept in sync: the enum-sync generator no longer emits `dialects` (free-form, like vendors); the Python SDK types `dialect` as a free-form string and gains the optional portable `expression`; the reference validator treats unregistered dialects as opaque (skipped) and validates the portable expression. Converters are otherwise unchanged except where the now-string dialect required a fix (the dbt dialect comparison uses `==`, and the sigma and hex converters no longer call `.value` on a dialect) and where the new portable `expression` is handled: the ontology converter carries it through its model and both conversion directions, and omni's round-trip test documents the portable marker as a normalization (its text survives as the dialect entry). Co-authored-by: Isaac <no-reply@databricks.com>
f60b217 to
f8d3508
Compare
kayemkim
left a comment
There was a problem hiding this comment.
I read this alongside the list thread and merged it locally onto current main (b42ce09), no conflicts. Three things on the code; the design points are on the list.
The hex check job fails at the head: ty check reports invalid-argument-type at load_ossie_dialect_expression.py:79, where _to_sqlglot_dialect(ossie_dialect: OssieDialect) now receives the str that OssieDialectExpression.dialect became. The runtime side matters more: that function ends in assert_never, so a document with a dialect outside the old enum, which this PR makes valid, raises AssertionError: Expected code to be unreachable, but got: 'DB_DIALECT' on export. I ran it directly with DB_DIALECT and SNOWFLKE; both raise. The wisdom test you added covers this case; hex needs the same, with the final branch returning None for anything unregistered and the parameter typed str.
Expression still lists dialects under required with minItems: 1, and OssieExpression.dialects keeps Field(..., min_length=1), so a portable-only document fails both the schema and the SDK:
[Schema] datasets -> 0 -> fields -> 0 -> expression: 'dialects' is a required property
A required of one of expression or dialects (anyOf) in the schema and a model validator in the SDK would match the behaviour the summary describes.
With #612 cherry-picked on top, the two tests that read $defs.Dialect.enum fail with KeyError (validation test_every_schema_dialect_is_mapped_or_skipped, Holistics test_every_schema_dialect_is_parsed_or_marked_not_sql); the table cross-check and the sqlglot reader tests pass. I can point those two at the table in extensions/dialects.md instead, in whichever order the two PRs land.
…from-vendor-dialects # Conflicts: # converters/dbt/src/ossie_dbt/ossie_to_msi.py # converters/hex/src/ossie_hex/ossie_to_hex/load_ossie_expression.py # converters/hex/src/ossie_hex/ossie_to_hex/pick_ossie_dialect_expression.py # converters/hex/tests/ossie_to_hex/test_pick_ossie_dialect_expression.py # converters/microsoft/tests/test_semantic_model_to_ossie.py # converters/omni/tests/_util.py # converters/ontology/src/ossie_ontology/converter/ossie_to_spec/converter.py # converters/ontology/src/ossie_ontology/converter/spec_to_ossie/converter.py # converters/ontology/src/ossie_ontology/model.py # converters/ontology/src/ossie_ontology/spec.py # converters/sigma/src/ossie_sigma/ossie_to_sigma.py # converters/wisdom/tests/test_ossie_to_wisdom.py # converters/wisdom/tests/test_wisdom_to_ossie.py
An Expression required `dialects` on both the JSON Schema and the SDK, so a document carrying only the portable top-level `expression` (OSSIE_SQL_2026) was rejected, contradicting the spec's stated semantics. - Schema: replace `required: [dialects]` with an anyOf requiring at least one of `expression` or `dialects`; `dialects` keeps `minItems: 1` when present. - SDK: make `OssieExpression.dialects` optional and add a model_validator that rejects an expression carrying neither form. - Tests: cover portable-only, dialects-only, both-present, and the empty cases on both the schema and the SDK. - Docs: note the "at least one" rule in spec.md and spec.yaml. Co-authored-by: Isaac <no-reply@databricks.com>
An unrecognized dialect is opaque and legitimate under the free-form `Dialect` model, so its SQL cannot be parse-checked. The validator skipped it silently, which also hid typos such as `SNOWFLKE`. `validate_sql` now tallies expressions whose dialect is not in `DIALECT_MAP` and emits one nonfatal `ValidationWarning` per distinct unknown dialect, with the count of affected expressions. Validation still passes. Known-but-unparseable dialects (MDX, DAX, HOLISTICS_AQL, ...) stay silent, and the per-call `validate_sql_expression` is unchanged. Co-authored-by: Isaac <no-reply@databricks.com>
Brings in the merged apache#591 (dataset-scoped metrics), apache#486 (name resolution), apache#614 and apache#619. Resolved conflicts: - python/src/ossie/models.py: union the pydantic imports (model_validator + SerializationInfo + TypeAdapter). - core-spec/spec.yaml, core-spec/spec.md: keep both the portable expression/dialects presence note and the upstream name-resolution notes; they are complementary. - validation/validate.py (semantic, not a text conflict): the shared _parse_sql_expression from apache#591 returns a (tree, error) tuple, so the unknown-dialect skip must return (None, None), not a bare None. This also makes validate_metric_scoping treat an unknown dialect as opaque. Co-authored-by: Isaac <no-reply@databricks.com>
The portable top-level key of the Expression object was `expression`, nested under a field/metric's own `expression:` block -- the doubled `expression.expression` Jochen flagged on the thread. Rename it to `sql` so the key reads cleanly and names what it holds: the portable OSSIE_SQL (OSSIE_SQL_2026) form. Scope is the portable key only. The field/metric `expression:` key (which holds the Expression object) and the per-dialect `dialects[].expression` key (already qualified by its `dialect:`) are unchanged. This key was introduced by this same unreleased PR, so the rename carries no migration burden; no released spec ever had `expression.expression`. No back-compat alias -- the old key is rejected (schema additionalProperties:false, SDK extra=forbid). Touches the schema anyOf + property, the SDK model and validator, the validator's portable reads, spec.md/spec.yaml/docs prose and examples, the tpcds portable example, and the mirrored tests. Co-authored-by: Isaac <no-reply@databricks.com>
A dataset-scoped metric may be written with only the portable `sql` form (no dialects). Such a metric escaped both checks: `validate_sql` only walked its `dialects`, so the portable form was never parsed; and `validate_metric_scoping` likewise only walked `dialects`, so the single-namespace scoping rules (no qualified references, declared fields only) were never applied to it. Both now handle the portable `sql` exactly like a dialect expression: it is parsed as OSSIE_SQL_2026 and scope-checked. A portable-only dataset-scoped metric with a cross-dataset reference or an undeclared field is now reported, as a dialect form already was. Adds four tests covering the portable form: a declared single-part field passes, a cross-dataset reference and an undeclared field are rejected, and an invalid portable expression is reported. Co-authored-by: Isaac <no-reply@databricks.com>
c1c223d to
c049fdb
Compare
The spec now lets an expression carry its portable OSSIE_SQL_2026 form as a top-level `sql`, alone or beside `dialects`, and makes it authoritative over an OSSIE_SQL_2026 entry there. Export read only `dialects`, so a valid sql-only expression raised "has no expression". It is now read as the OSSIE_SQL_2026 form, keeping the existing order (selected dialect, then ANSI_SQL, then OSSIE_SQL_2026); when it and an OSSIE_SQL_2026 entry differ, the top-level `sql` wins with a warning. Import keeps writing `dialects`, since a Solid formula is warehouse SQL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Register PYICEBERG the way #617 lays out: a row in extensions/dialects.md, a NON_SQL_DIALECTS entry so the validator carries its expressions without parsing them, and the well-known value on OssieDialect. PYICEBERG is the predicate string accepted by PyIceberg's expression parser, for boolean fields. Its reference, with the supported predicates, operand rules and PyIceberg 0.10.0 as the minimum reference version, moves to extensions/dialects/pyiceberg.md, so the PR no longer touches the core spec. sqlglot's default reader accepts most PyIceberg strings and also the function calls PyIceberg rejects, so the dialect is listed as non-SQL rather than validated as SQL. Closes #142 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Bumps the ossie submodule to a498fce, which includes apache/ossie#617: `dialect` is a free-form string, `dialects` is optional, and the expression object gains an optional portable `sql`. This restores the converters that failed against the new pin; reading `sql` is left as a follow-up. - hex: tolerate an absent `dialects`. A field or metric that has only `sql` is omitted with an error, where hex raised `TypeError` before. Tests expect the dialect in warnings as a `str`, which the new SDK gives. - dbt: use the dialect string directly, so every dialect is valid, and compare dialects by value, not identity. - sigma: stop calling `.value` on a dialect, which is a `str` now. - wisdom: compare dialects by value in tests. - lightdash: compare dialects by value in tests. - ontology: accept `expression.sql`; it is not converted. - omni: the tpcds round trip normalizes `expression.sql` away. - microsoft: remove `test_dax_is_a_spec_dialect`, which read the removed `$defs.Dialect.enum`; every dialect string is valid now. Fixes apache#61 Co-authored-by: Isaac <no-reply@databricks.com>
Since apache/ossie#617, `expression.dialects` is optional and an expression may carry only the portable `sql`. dbt, sigma, wisdom and the salesforce converter read `dialects` unguarded and failed on such a document (`TypeError: 'NoneType' object is not iterable`, a `NullPointerException` in salesforce). snowflake, nvidia and holistics aborted the whole conversion, although the same document with only an unregistered dialect converts. hex and omni already dropped the field or metric with a diagnostic. Treat an absent `dialects` as an expression with nothing to convert, so the field or metric is dropped with a diagnostic until a follow-up reads `sql`: - dbt: the metric is dropped with UNSUPPORTED_METRIC_EXPRESSION. - sigma: fields get EXPRESSION_NOT_TRANSLATABLE and the metric is dropped. The diagnostic that lists the available dialects needed the same guard. - wisdom: a field or metric without dialect entries is skipped with MISSING_DIALECT_EXPRESSION. Wisdom has no drop path today and fell back to `dialects[0]`, which does not exist here, so it needs an explicit skip. - snowflake: skipped with a warning, as for an unsupported dialect. - nvidia: skipped with a warning. - holistics: dropped with a HOLISTICS_NO_USABLE_DIALECT error. The body is picked before the block is built, so a dropped field does not also report an assumed type. - salesforce: the field is omitted with a warning. This change is not compiled or tested here, because the build needs Maven. An expression with neither `sql` nor `dialects` still raises in snowflake, nvidia and holistics. Co-authored-by: Isaac <no-reply@databricks.com>
…/ossie#617) (#78) * fix(converters): adapt to free-form dialects (apache/ossie#617) Bumps the ossie submodule to a498fce, which includes apache/ossie#617: `dialect` is a free-form string, `dialects` is optional, and the expression object gains an optional portable `sql`. This restores the converters that failed against the new pin; reading `sql` is left as a follow-up. - hex: tolerate an absent `dialects`. A field or metric that has only `sql` is omitted with an error, where hex raised `TypeError` before. Tests expect the dialect in warnings as a `str`, which the new SDK gives. - dbt: use the dialect string directly, so every dialect is valid, and compare dialects by value, not identity. - sigma: stop calling `.value` on a dialect, which is a `str` now. - wisdom: compare dialects by value in tests. - lightdash: compare dialects by value in tests. - ontology: accept `expression.sql`; it is not converted. - omni: the tpcds round trip normalizes `expression.sql` away. - microsoft: remove `test_dax_is_a_spec_dialect`, which read the removed `$defs.Dialect.enum`; every dialect string is valid now. Fixes #61 Co-authored-by: Isaac <no-reply@databricks.com> * fix(converters): tolerate expressions that carry only sql Since apache/ossie#617, `expression.dialects` is optional and an expression may carry only the portable `sql`. dbt, sigma, wisdom and the salesforce converter read `dialects` unguarded and failed on such a document (`TypeError: 'NoneType' object is not iterable`, a `NullPointerException` in salesforce). snowflake, nvidia and holistics aborted the whole conversion, although the same document with only an unregistered dialect converts. hex and omni already dropped the field or metric with a diagnostic. Treat an absent `dialects` as an expression with nothing to convert, so the field or metric is dropped with a diagnostic until a follow-up reads `sql`: - dbt: the metric is dropped with UNSUPPORTED_METRIC_EXPRESSION. - sigma: fields get EXPRESSION_NOT_TRANSLATABLE and the metric is dropped. The diagnostic that lists the available dialects needed the same guard. - wisdom: a field or metric without dialect entries is skipped with MISSING_DIALECT_EXPRESSION. Wisdom has no drop path today and fell back to `dialects[0]`, which does not exist here, so it needs an explicit skip. - snowflake: skipped with a warning, as for an unsupported dialect. - nvidia: skipped with a warning. - holistics: dropped with a HOLISTICS_NO_USABLE_DIALECT error. The body is picked before the block is built, so a dropped field does not also report an assumed type. - salesforce: the field is omitted with a warning. This change is not compiled or tested here, because the build needs Maven. An expression with neither `sql` nor `dialects` still raises in snowflake, nvidia and holistics. Co-authored-by: Isaac <no-reply@databricks.com> * fix(dbt): read the top-level sql of an expression A field whose expression carries only `sql` has no `dialects` entry, so the lookup found nothing and the field was emitted with `expr: ""`. MetricFlow reads an empty `expr` as the element name, so `amount_usd` with `sql: amount * 1.1` silently became the column `amount_usd`. Treat `sql` as an OSSIE_SQL_2026 candidate in the dialect lookup. It ranks after the converter's own dialect and wins over an OSSIE_SQL_2026 entry, as the spec requires. Fields and metrics both read it, so a `sql`-only metric is now converted and no longer dropped. Co-authored-by: Isaac <no-reply@databricks.com> * fix(converters): read the top-level sql in ontology, nvidia and salesforce A field whose expression carries only `sql` lost that expression in three converters: - ontology: `spec_to_ossie` copied only `dialects`, so the field read the column it is named after. `ossie_to_spec` then wrote `expression: {}`, which the core schema rejects. - nvidia: the field was skipped. A key or a relationship that named it then pointed at a column the table does not have. - salesforce: the field was omitted. A primary key field counts as covering the key, so the key and every relationship joining on it were also lost. Read `sql` as an OSSIE_SQL_2026 expression, as dbt does. It wins over an OSSIE_SQL_2026 entry, as the spec requires, and ranks after the dialect each converter prefers (ANSI_SQL in nvidia, TABLEAU in salesforce). In ontology it becomes the first entry, so it is written back under `dialects`. Writing it back as `sql` is left to #79. salesforce is not compiled or tested here, because the build needs Maven and JDK 21. Co-authored-by: Isaac <no-reply@databricks.com> * fix(holistics): render a sql-only expression instead of dropping it Dropping the dimension left the primary key and any relationship naming it pointing at a dimension that was never written, so the conversion succeeded with AML referencing a missing field. Before the pin bump the same input was a ConversionError. The top-level `sql` is OSSIE_SQL_2026, which pick_body already renders through its portable path. dialects_of now exposes it as the OSSIE_SQL_2026 body, replacing an OSSIE_SQL_2026 entry as the spec requires, and pick_body and its callers go back to their shape on main. --------- Co-authored-by: Isaac <no-reply@databricks.com> Co-authored-by: JB Onofré <jbonofre@apache.org>
…ext refs Since apache/ossie#617 an expression may carry only `sql` (OSSIE_SQL_2026), and `sql` is authoritative over an OSSIE_SQL_2026 entry in `dialects`. expression_text now reads `sql` first and refuses an expression with neither; a dataset-scoped metric promoted to a model metric falls back to OSSIE_SQL_2026 when no dialect entry holds its text. A dimension or time field named in agent_context that the dataset no longer declares (renamed or removed in the Ossie file) is now refused with the reference and the fix, instead of an uncaught StopIteration for a dimension or a guessed raw column for the time field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… audit (#711) * docs(spec-changes): correct and complete the 0.3.0.dev0 history Update the #577 and #591 rows, which later PRs superseded: #587 set the default NULL placement in window ORDER BY, and #633 lets dataset-scoped metrics reference source columns as source.column. State the #617 precedence of expression.sql as the MUST the spec makes it. Add the breaking changes merged in this window (#397 root dialects and vendors removed, #400 ontology uri renamed to iri, #486 name resolution), together with #587, #633 and the Layer 3 interface (#653). * fix(scripts): make the spec change audit see all of main Drop --first-parent: on a branch that has merged main, it followed the branch and skipped every main commit merged after the branch forked. Resolve the default history file and the pathspecs from the repository root, so running from a subdirectory no longer reports no candidates. Read --since as midnight UTC, matching the dates in the history, instead of the current local time on that date. Strip GIT_* variables and the user's git config from the test environment, so the tests cannot act on the developer's repository when run from a git hook, and run them in Validation CI.
…203) Stage 1 of #79 for ThoughtSpot: the reader takes a portable expression from either location, preferring `expression.sql`. The writer does not move. apache/ossie#617 made `expression.sql` the top-level home of the portable expression; `expression.dialects[]` still carries a tagged `OSSIE_SQL_2026` entry, so a document may present either or both. A new helper, `portable_expression_entries`, folds a usable `sql` in as the entry it already is, so all four read sites see one shape instead of each learning the second location. A usable `sql` supersedes every other entry except THOUGHTSPOT. Narrowing that to the portable dialects alone is not enough: two of the readers scan the entry list for a bare column identifier across any dialect, so a foreign vendor entry beside a `sql` field produced a wrong `db_column_name` -- and, where the authoritative expression was an aggregate, a physical column with no formula and no issue at all. Both are silent wrong output; both are now pinned. A superseded sibling is therefore not a fallback. When `sql` is present and this converter cannot translate it, the field or metric is reported and dropped rather than quietly converted through an expression the document marks as not authoritative. That is a behaviour change for a document carrying a translatable tagged entry beside an untranslatable `sql`, and it is a declared loss in place of a silent one. Ordering `sql` ahead of a tagged ANSI_SQL entry follows #79 and the databricks reference implementation (OssieConverterCommon.java), not the schema, which makes `sql` authoritative only against an OSSIE_SQL_2026 entry. Honeydew #182 is not precedent for the vendor-native-first step: it has no vendor dialect. Also pins, as a limit rather than a fix, that a dataset-scoped metric is read by nothing today -- the converter has no dataset-scoped path, so such a metric is dropped with no formula and no issue. That gap belongs to #30. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
#79 stage 2) (#215) * feat(thoughtspot): write the portable expression to expression.sql Stage 2 of #79 for this converter, and the other half of apache/ossie#617. #203 is stage 1: it taught the reader to accept a top-level `expression.sql`. With that in place the writer can emit one. `sql` is the specification's PRIMARY portable form, and either location may stand alone, so a consumer reading `sql` alone -- which the spec invites -- saw nothing portable from this converter at all. Every portable expression it produced lived only in `dialects[ANSI_SQL]`. Additive, never a replacement. The ANSI_SQL entry stays exactly where it was: PORTABLE_DIALECT is ANSI_SQL rather than OSSIE_SQL_2026 on the emit side because a survey of this repository found omni and sigma drop a metric carrying only OSSIE_SQL_2026 (#22), and moving the expression into `sql` would reintroduce that loss. One string serves both -- apache/ossie#450 established the two dialects parse identically. Nothing new is translated. An expression with no portable sibling still has none and still carries TS-EXPR-THOUGHTSPOT-ONLY; `sql` copies a portable form that exists, it does not invent one. The fixtures show the scale of that: 37 `sql` lines added, nothing removed or changed. The round trip is unaffected. THOUGHTSPOT still outranks `sql` on the way back in -- `portable_expression_entries` returns [THOUGHTSPOT, sql] -- so our own documents re-read exactly as before. Both fixtures still validate against the upstream schema. Four mutations of the writer were run; all four were killed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs(thoughtspot): describe the writer emitting expression.sql The README still said the writer had not moved and that expressions are written back as dialects[] only. Describe stage 2 of #79: a portable expression is written to the top-level sql and kept as the tagged ANSI_SQL entry beside the verbatim THOUGHTSPOT one. --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: JB Onofré <jb@nanthrax.net>
* feat(atlan): add Atlan metric registry converter Registry metric records <-> Apache Ossie, both ways, offline. Import folds filters into every aggregate, binds parameters, splits whole-query formulas into one metric per output, and carries what a talk-to-data agent needs in custom_extensions[ATLAN]; export rebuilds a registry definition from one Ossie metric; write-back produces the versioned registry patch an edit implies. Shapes Ossie cannot express are per-metric issues, not file refusals. 19 golden cases on a synthetic TPC-DS registry (tests/fixtures), validated against the core-spec schema, apache/ossie's validator and the registry's metric kind schema. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * feat(atlan): review fixes: parked date windows, refusals for wrong-number shapes, public lockfile Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * feat(atlan): round-two review fixes, public lockfile, sqlglot>=28 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * feat(atlan): add dependabot entry for the atlan converter Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(atlan): address review: unqualified columns in joins, zero_denominator round trip, backticked names - A raw-SQL query that joins tables and has an unqualified column is refused with the column names, instead of the column being assigned to the base table. - COALESCE(expr, 0) around the whole expression is read back as aggregation.zero_denominator rather than copied into the registry formula, so forward -> write-back -> forward is stable. - Table-name parts drop backticks as well as double quotes, so BigQuery and Databricks names give valid dataset names and table-qualified columns resolve. Each comes with a test that fails on the previous code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(atlan): tighten the review fixes after verification - zero_denominator: COALESCE(<expr>, 0) is read back as the setting only for a record whose zero_denominator is zero, and only with a numeric 0. A COALESCE the author wrote stays in the formula, and an already wrapped expression is not wrapped twice. - Table names are parsed in one place, in the record's dialect: BigQuery's `proj.ds.tbl` in one pair of backticks is three parts, four-part names work, and a name that is not a plain table reference, does not parse, or uses quotes the dialect does not use is refused. The dataset source keeps quoted parts exactly as written and folds unquoted parts per dialect; quoted and unquoted spellings of one table match when a join is resolved. Dataset names are valid identifiers that do not read as keywords. - When a record's SQL joins tables (a whole-query formula or a source.sql row set), a column with no table prefix is refused in the SQL (including ON clauses) and in the formula, filters, dimensions and timeframe_column; a required_join that names no join is refused. A dimension's filter_form puts a bare column on the dimension's own table. The structured-field convention is documented in registry-format.md; the README lists every refusal. - New golden fixture bigquery_backticked_names; tests for each case above. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(atlan): register in the interop matrix The interop matrix (#62) requires every converter project to be registered, so this adds Atlan: a manifest entry with CLI import and export, `atlan` as a file-shaped native format whose members are the metric records of a registry export, a native fixture of ten synthetic TPC-DS records, the interop CI path filter, and the README rows. What the matrix needed from the converter: - `export` with no `--metric` writes every metric as registry records (`{"artifacts": [...]}`), the shape `import` already reads. A metric the registry cannot express is a METRIC_NOT_CONVERTIBLE issue and the rest are still written. `--metric NAME` is unchanged. - A record with no registry id imports as a metric not yet in the registry, so exported new metrics read back. Write-back refuses such a metric (NotWritable), since there is no record to patch. - Dataset-scoped metrics (`datasets[].metrics`, apache/ossie#591) were ignored on export; they now export with their bare columns read as their own dataset's. A name two metrics share is refused. - A document with no `metrics` is an Ossie document: export writes an empty registry export instead of refusing the file. Also aligns the setup-python and setup-uv pins in the Atlan workflow with the ones main uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(atlan): read a dataset metric's own field before a metric of that name A dataset-scoped metric names its dataset's fields unqualified, so a field `amount` is that field even when a model metric is also called `amount`; it was refused as "built from other metrics". Also counts Atlan in the README converter totals (23) and writes Atlan's native output with a .json suffix in the runner, matching checks.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(atlan): read top-level expression.sql and refuse stale agent_context refs Since apache/ossie#617 an expression may carry only `sql` (OSSIE_SQL_2026), and `sql` is authoritative over an OSSIE_SQL_2026 entry in `dialects`. expression_text now reads `sql` first and refuses an expression with neither; a dataset-scoped metric promoted to a model metric falls back to OSSIE_SQL_2026 when no dialect entry holds its text. A dimension or time field named in agent_context that the dataset no longer declares (renamed or removed in the Ossie file) is now refused with the reference and the fix, instead of an uncaught StopIteration for a dimension or a guessed raw column for the time field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(atlan): target the Ossie 0.3.0.dev0 specification ossie#691 moved the in-development version to 0.3.0.dev0 and the schema rejects 0.2.0.dev0. The converter now writes 0.3.0.dev0, the golden fixtures follow, and the golden validator test runs every check of ossie's validate_document instead of a hand-picked subset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: shubhambatlan <217801236+shubhambatlan@users.noreply.github.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
The spec now lets an expression carry its portable OSSIE_SQL_2026 form as a top-level `sql`, alone or beside `dialects`, and makes it authoritative over an OSSIE_SQL_2026 entry there. Export read only `dialects`, so a valid sql-only expression raised "has no expression". It is now read as the OSSIE_SQL_2026 form, keeping the existing order (selected dialect, then ANSI_SQL, then OSSIE_SQL_2026); when it and an OSSIE_SQL_2026 entry differ, the top-level `sql` wins with a warning. Import keeps writing `dialects`, since a Solid formula is warehouse SQL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(solid): add bidirectional Solid semantic model converter Moved from apache/ossie#352 after the converters moved to this repository (apache/ossie#523). The converter is unchanged from that PR's last reviewed commit (1b0f103), which had addressed three review rounds; only repository paths changed: * tests read the spec schema and examples from the `ossie` submodule * README links to spec files point at apache/ossie * pyproject `repository` points at this repository Also adds the per-converter files this repository expects: a converter-solid-ci.yml workflow, labeler and dependabot entries, and a SOLID row in the README vendor table. The converter is a bidirectional offline transform between an Apache Ossie semantic model and a Solid semantic model YAML export. Import (Solid -> Ossie) keeps every Solid-only construct in custom_extensions[SOLID]; export (Ossie -> Solid) uses the key order Solid's own exporter uses and warns about what Solid's format cannot hold. The design calls (dialect inference from the column type vocabulary, surgical-splice qualification of metric expressions, and relationship direction recovered from primary keys) are documented in solid/README.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): fail cleanly on malformed input, keep YAML dates Review: an unquoted YAML date (`sample_values: [2024-01-01]`) made json.dumps raise TypeError, which the CLI showed as a traceback. The stash now tags dates and datetimes (the pattern the Omni converter uses), so they come back as the same type and re-dump unquoted, and a value JSON cannot hold raises a ConversionError. The same family was wider than dates. A sweep that replaces every value in a model with each other YAML kind found 17 places where valid YAML of the wrong shape escaped as a Python error, in both directions: `fields: true`, an `expression` written as a string, a `custom_extensions` entry that is not a mapping, a `datatype` given as a mapping, and so on. List, mapping and string fields are now read through checked accessors: null still reads as empty, since Solid writes an empty list that way, and a value of the wrong kind raises a ConversionError naming the object. A wrong-kind value that used to be read as empty, and so dropped silently, now raises too. That sweep now runs in the suite (test_malformed_input.py). Also: * the CLI reads and writes UTF-8 explicitly, and reports input that is not UTF-8 instead of a UnicodeDecodeError traceback; * a description YAML read as a number or date is kept as text rather than dropped; * an unknown `datatype` name is ignored with a warning, so a model from a later spec version still converts; * write_stash's docstring said it merges into an existing entry; it replaces it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): decide each field's role on its own, keep computed dimensions Review: if any field had a `dimension` block, every field without one was exported as a fact. That held for models this converter wrote, but the Microsoft and Omni converters mark only time fields, so their plain attributes became facts. And only facts had a stashed role, so a dimension with an `expression` lost it on Solid -> Ossie -> Solid, which the README called lossless. Import now stashes every column's role (`dimension`, `fact`, `metric`) and marks a dimension that carried an expression as `computed`, so its expression is written back. Export decides each field on its own: 1. A `dimension` block, or the stashed role. A block added in Apache Ossie wins over a stashed fact, with a warning, since it is an edit. A missing block does not override a stashed dimension: the block is optional and a tool that does not read it may drop it, the same rule a dropped `datatype` follows. 2. The datatype, by Solid's type rule. 3. With no datatype either, the producer's convention. Applying the datatype rule alone would make every untyped field a dimension, which moves GoodData's and OrionBelt's measures (`ss_quantity`, `ss_net_profit`) out of facts: those converters mark every dimension and write no datatype. So a model that puts a block on any field that is not a time dimension has its unmarked fields read as facts; one that marks only time fields (Omni, Microsoft) does not. The cross-vendor sweep now asserts the split, stated in terms of what the other converter wrote: a field with a block is a dimension, an unmarked one with a numeric datatype a fact, any other datatype a dimension. That covers 135 fields across ten fixtures and cannot break when another converter edits its fixtures. The untyped convention case is pinned against inline models. The BigQuery fixture gains a computed dimension, so the exact round-trip tests cover it. The README described the type rule as "the way Solid itself does it". It is the type-prefix part of solid-server's split, which also weighs column names and cardinality; being a prefix match it makes BIGINT a dimension and INTERVAL a fact, as in Solid. The README and a test now say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): use each warehouse's default decimal scale, write scaled types Review: bare NUMERIC, DECIMAL and BIGNUMERIC always mapped to Integer. That is right for Snowflake (38,0) and Databricks (10,0), but BigQuery's NUMERIC and DECIMAL default to (38,9) and BIGNUMERIC to scale 38, so a BigQuery `price NUMERIC` imported as Integer. The code comment said BigQuery defaulted to scale 0, and the README table said Decimal in every dialect; both were wrong. The default scale now depends on the dialect, a precision alone still declares a scale of 0, BIGDECIMAL is recognized, and the README has a table per dialect. Review: a hand-written `Decimal` field was written back as NUMBER, DECIMAL or NUMERIC, integer-scaled in each warehouse, so it re-imported as Integer and Solid got an integer catalog type for a money column. Decimal is now NUMBER(38,9) / DECIMAL(38,9) / BigQuery NUMERIC. The same check found Opaque written as STRING or VARCHAR on Databricks, BigQuery and ANSI, which read back as String; those are now VARIANT and JSON. A test now checks every datatype in every dialect against the type written for it, with the one type a warehouse lacks (Time on Databricks) declared as an exception, and the round-trip test JB pointed at compares each field's datatype after re-import. Siblings in the same tables: * The dialect markers claimed each name appears in only one warehouse, but GEOGRAPHY is BigQuery's too and VARIANT and GEOMETRY are Databricks types now, so [STRING, GEOGRAPHY, DATE] was confidently Snowflake. Those three no longer vote. * Oracle and SQL Server are Solid sources with no Apache Ossie dialect. Oracle's NUMBER voted Snowflake and SQL Server's BIGINT Databricks; a name only they report (VARCHAR2, DATETIME2, ...) now sends inference to ANSI_SQL with a warning, and their common types map to datatypes. The README says which other sources need --dialect. * Qualified intervals (INTERVAL DAY TO SECOND), CHARACTER VARYING, Snowflake VECTOR and BigQuery RANGE had no datatype. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): quote reserved words from an explicit list per dialect Review: column_reference decided whether a name needed quoting by rendering it bare and parsing it back, but sqlglot reads `order`, `group` and `limit` as ordinary columns. They stayed unquoted on Snowflake, Databricks and ANSI_SQL, so a Solid table `db.s.order` with a `group` column imported as the field `group` and the metric `SUM(order.amount)`, both invalid SQL. (BigQuery already quoted them only because sqlglot ships a reserved list for BigQuery and no other dialect.) The reserved words are now listed per dialect, from each warehouse's documentation; Snowflake's is the same 92 words solid-server's SNOWFLAKE_RESERVED_WORDS_SET holds. A name is quoted when it is not a regular identifier or is reserved there, and dataset qualifiers go through the same function, so the metric becomes `SUM("order".amount)` and still unqualifies on export. Review: on Snowflake quoting makes a name case-sensitive. Solid reports names as INFORMATION_SCHEMA stores them (solid-server normalize_step copies `source_field.name` verbatim; every Snowflake model in our examples is upper case), so a reserved column created unquoted arrives as ORDER and is written `"ORDER"`, which matches it. The old check also over-quoted: `comment`, which Snowflake does not reserve, came out as `"comment"`. Snowflake's list is kept to exactly the documented words for that reason; Databricks and BigQuery match backtick-quoted names case-insensitively, so their lists also take in the standard's. Tests: every listed word in every dialect is quoted and its quoted form parses back as a column of that name; the BigQuery list must cover the one sqlglot ships; Snowflake ORDER and COMMENT are pinned; and JB's example round-trips in all four dialects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): keep a metric's qualifiers when stripping them would collide Review: removing the dataset qualifiers from a metric that spans several datasets could turn two different columns into the same bare name, with no warning: `SUM(orders.amount) - SUM(returns.amount)` became `SUM(amount) - SUM(amount)`, ambiguous in Solid or always zero. unqualify_metric now returns AMBIGUOUS when the same bare name is read from two datasets, so the expression is kept as written and the existing warning fires. JB's wording, a bare name that exists in more than one of the referenced datasets, also covers a case with no textual collision: `SUM(orders.amount) / COUNT(customers.id)` when `orders` has an `id` too. Catching that needs each dataset's field names, which export now passes in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): carry structured instructions, report every drop, read new versions Not raised in review, but the same "lossless" and "never silently drops" claims did not hold in three more places. Solid's structured custom instructions were lost. Since September Solid's export writes custom instructions as a root-level `custom_instructions` list (title, is_enabled, condition, content, associated_assets) and then leaves `business_context.custom_instructions` out. Import never read the list, so every current export that uses it lost all of its instructions on Solid -> Ossie -> Solid, with no warning. Import now renders the free text and each enabled entry into `ai_context.instructions` (a disabled entry is not in force, so it is not rendered), resolving asset links as before, and stashes the entries. Export restores them while the instructions still read as import wrote them; an edit wins, with a warning, as for the other stashed values. The Databricks fixture now uses the structured form, so the exact round-trip tests cover it. Export dropped some constructs without saying so: a metric's ai_context.instructions, model-level ai_context.synonyms, extra keys an ai_context may carry, and an explicit `dimension.is_time` that the datatype does not imply (the spec's own `d_year` and `d_quarter_name`). Each is now reported. That also covers a key a later version of either format adds, which would otherwise vanish the way the instruction list did: import reports any key Solid's export template does not write, and export any key outside the spec's closed objects. Export rejected any spec version but 0.2.0.dev0 and 0.1.1, so a spec release would have made every document fail. Another version is now read as 0.2.0.dev0 with a warning, and a document with no version, or a Solid model passed to export, still raises with a clear message. README: the stash row for relationships said it records "position"; it records only whether import flipped the pair. Known differences now mention trimmed whitespace. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): read a bare NUMBER or DECIMAL as Decimal Correcting 81e8fec, which gave bare exact-decimal types their warehouse's default scale, so a bare Snowflake NUMBER and Databricks DECIMAL read as Integer. That default describes a type declaration, not what Solid reports: Solid copies a column's type from the catalog's DATA_TYPE, which on Snowflake and Databricks never carries the precision or scale (those are separate catalog columns). Every one of the 151 NUMBER and DECIMAL columns in the real Solid exports this was checked against is bare, and 58 of them are rates, percentages or dollar amounts (ARR_USD, ADOPTION_RATE_PCT, serp_engagement_rate), which would all have been typed as whole numbers. A bare name is now a Decimal in every dialect, which is what the spec's Decimal means: exact base-10 with unspecified precision and scale. Only a scale known to be 0 is an Integer: a declared one, or a precision alone. This also covers Oracle's bare NUMBER, a floating decimal. Integer is written back as NUMBER(38,0) on Snowflake so it reads back the same. Oracle and SQL Server models now get a warning that names the types it recognized, instead of "could not infer". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): match column and dataset names sqlglot tokenizes as keywords The qualifier splice only looked at VAR and IDENTIFIER tokens, but sqlglot tokenizes many ordinary names as keywords: a table called `session`, `date`, `comment`, `index`, `first`, `range` or `view`, and a column with any of those names. Import then wrote `SUM(session.amount)` and export could not strip it, leaving the qualifier in Solid with an "ambiguous" warning; a column called `date` was never qualified, with a warning that it "also appears in a non-column position". Every dialect was affected. A keyword token spelled like a name now counts as a candidate, and the existing AST cross-check still decides whether each match is a column, so `CAST(x AS DATE)` beside a column called `date` is still left alone. Tests cover 22 such names, as datasets and as columns, in all four dialects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): close the gaps an independent review of round 4 found A review of the round-4 commits against the same checklist found these, each now covered by a test: * Export accepted two datasets whose names differ only in case. Metric qualifiers match ignoring case, so `SUM(orders.amount) - SUM(ORDERS.amount)` still collapsed to `SUM(amount) - SUM(amount)`, with no warning. That is now rejected, as import already rejects it. * Python errors still escaped from inside the stash, which the malformed-input sweep never reached because it only replaced a stash's JSON string whole: a tagged date with a bad value, `renamed.from` that is not a string, metric `tables` holding a number, and a mapping keyed by a YAML date. The sweep now also mutates every value inside each stash, and those raise ConversionError. * A `datatype` of the wrong kind beside a `dimension: {}` block raised TypeError, because the time-role check ran before it was validated. * A list or mapping in a text slot (`description`, `type`, the old `business_context.custom_instructions` holding the structured list) was dropped silently; it now raises. * A metric fact edited in Apache Ossie kept its stashed role: a datatype given to it was ignored, and an expression made a plain reference left it a metric. Both edits now win. * A computed dimension with no type came back with `type: ''`; a column named with an escaped quote was reported as computed; `is_time` was reported lost when only `datatype` had been dropped and the stashed type still implied it; a stashed `flipped: "no"` flipped. * The cross-vendor sweep globbed `*/tests/fixtures/*.yaml`, missing eleven Apache Ossie documents (JSON, nested directories, Java test resources) while the README said it covered every one. It now finds all 21; the three whose expressions are only in a language that is not SQL are checked to raise, as documented. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): qualify a struct path at its head Found in review of the round-4 changes. A Solid formula that reads into a STRUCT column, `COUNT(DISTINCT customer.id)`, was left unqualified on import, because a column followed by a dot was taken to be a qualifier. An Apache Ossie reader then takes `customer` for a dataset, and when the model also had a `customer` table, so did this converter's own export: the metric came back bound to that table, with a warning that wrongly said it had been edited. Solid stores formulas against bare names, so a path that starts with one of the table's columns is a field access, and import now puts the dataset in front of the whole path (`orders.customer.id`). Export strips the qualifier off `dataset.field.member` when `field` belongs to that dataset, and still leaves a schema-qualified `db.table.column` alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): quote a Snowflake reserved word in the case it folds to Found in review of the round-4 changes: Snowflake quoting was internally inconsistent. A reserved name was quoted as written and every other name left bare, but a quoted name matches exactly and a bare one folds to upper case, so lower-case `"order"` and `region` in one model could not both name real columns. A reserved word is now quoted in upper case, `order` -> `"ORDER"`: the column it would name written bare, as every other name and Solid's own formulas are. For Solid's own Snowflake exports, which carry names upper case as INFORMATION_SCHEMA stores them, that is the name as reported. Snowflake's documentation restricts eight of the 92 words only "as an identifier in a SHOW command" (ACCOUNT, CONNECTION, DATABASE, GSCLUSTER, ISSUE, ORGANIZATION, SCHEMA, VIEW), so they are ordinary column names and aliases and no longer quoted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(solid): name the hand-edited spellings that come back normalized A metric formula that qualifies its columns with its own table, and a composite primary key not joined with ", ", come back in the form solid-server's export writes. Neither occurs in Solid's own exports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): follow the spec's metric scoping and name resolution The ossie submodule bump (#58) brought two spec changes that affect this converter. Dataset-scoped metrics (apache/ossie#591): a dataset may now declare its own `metrics`, whose expressions read its fields unqualified. Export read them as an unknown key and dropped them with a warning that called them "not part of" the spec. They are now converted to Solid metrics bound to the dataset that declares one, which is what a Solid metric with one table is. A name shared with another metric gets the dataset's name as a prefix, with a warning, and one that reads another dataset (which the spec forbids) is reported. The TPC-DS example now carries one. Name resolution (apache/ossie#486): a model-scoped metric must qualify every field as `dataset.field`. Import left a cross-table metric unqualified, so those were no longer valid. Each column only one of the metric's tables has can only be that table's, so import now qualifies it, and only a metric reading a column more than one of its tables has is left as written, as before. In the real Solid exports checked that is one cross-table metric in six, and the TPC-DS example's model metrics now survive Ossie -> Solid -> Ossie verbatim, with no warning on re-import. Import still writes model-scoped metrics, which every consumer reads; a single-table metric could be dataset-scoped once the other converters read that form, which the README notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(solid): use the action pins the other converters moved to Matches the github-actions bump on main (#72): setup-python v7.1.0 and setup-uv v10.3.2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): drop query-backed datasets, resolve scoped paths and collisions by binding Three export gaps from review, each with the cases next to it. A dataset's `source` may be a SQL query (Cube writes some). Export named a Solid table after the SQL and bound relationships and metrics to it. Solid's tables come from the warehouse catalog, so a source sqlglot parses as a query is now dropped with a warning, together with its dataset-scoped metrics, every relationship that joins it, and every metric that reads it. Text sqlglot cannot parse is still taken as a table name, and a model whose every source is a query is rejected. In a dataset-scoped metric, `customer.id` was read as dataset `customer` whenever one existed, even when `customer` is a struct field of the metric's own dataset. Metric Scoping rule 1 allows only the dataset's own fields there, so a path's head is resolved against them first. Stripping qualifiers checked for a shared column name only among the datasets the expression names. A metric is also bound to its scoped dataset, or to the tables import recorded, so `SUM(amount) - SUM(returns.amount)` on `orders` came out as `SUM(amount) - SUM(amount)`. The check now covers every dataset behind the metric's final `tables`, and keeps the qualifiers with a warning when one would collide. The same applied to a model-scoped metric with stashed tables. Metric warnings now name a dataset-scoped metric as `dataset.metric`, since two datasets may each declare one with the same name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(solid): read the top-level expression `sql` (apache/ossie#617) The spec now lets an expression carry its portable OSSIE_SQL_2026 form as a top-level `sql`, alone or beside `dialects`, and makes it authoritative over an OSSIE_SQL_2026 entry there. Export read only `dialects`, so a valid sql-only expression raised "has no expression". It is now read as the OSSIE_SQL_2026 form, keeping the existing order (selected dialect, then ANSI_SQL, then OSSIE_SQL_2026); when it and an OSSIE_SQL_2026 entry differ, the top-level `sql` wins with a warning. Import keeps writing `dialects`, since a Solid formula is warehouse SQL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): fail cleanly on deep nesting, stash non-finite floats as JSON Input nested deeply enough to exhaust Python's recursion limit, in the YAML or in a SOLID stash, escaped the CLI as a RecursionError traceback. The YAML and stash readers now raise a ConversionError for it, and the CLI catches what is left, so both commands exit 1 with an Error: line. YAML reads `.nan` and `.inf` as floats, and json.dumps wrote them into the stash as `NaN` and `Infinity`, which strict JSON readers reject. They are now tagged like dates, so the stash stays valid JSON and the same floats come back on export. sqlglot's floor was 25.0, which nothing here has run against; it is now the 30.17.0 the lock pins and CI tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): carry Solid's new export fields, read the dialect from source_system solid-server's YAML export gained four root keys this month: `version_number` and `source_system`/`target_system` (RND-9268, RND-9227) and `model_llm_short_description` (RND-9478). Import reported each as unknown and dropped it, so a current Solid export no longer came back unchanged. They are now stashed and restored in the template's key order. `source_system` names the warehouse, which the README noted Solid's export used to leave out. It now sets the dialect after an explicit --dialect: snowflake, databricks and big_query map to their dialects, and any other warehouse reads as ANSI_SQL with a warning naming it. Inference from column types remains for older exports, and no longer counts BIGINT, SMALLINT or TINYINT as Databricks: Postgres, Redshift, Trino and Athena report them too, which labelled a Starburst model DATABRICKS and read its timestamps as time-zoned. Solid's Databricks exports spell 64-bit integers LONG, so they still infer correctly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): leave a metric as written when a qualifier could rebind a name Adding or removing a dataset qualifier is only safe while every column still means what it did. Three cases broke that, each with no warning: - A subquery or lambda declares names of its own. Import qualified the inner `customer_id` of `customer_id IN (SELECT customer_id FROM crm.vip)` with the outer table, correlating the subquery to the outer row, and export's `r.order_id = orders.order_id` became `r.order_id = order_id`, comparing a column with itself (likewise a lambda's parameter). Neither direction now rewrites such an expression. - A qualifier that is not a dataset (a table alias, `p.amount`, or the table's full name) passed through import unchanged, so the metric was one an Apache Ossie reader cannot resolve. Two real Solid exports carry such a metric. Import now leaves it as written with a warning, as it does a metric reading a name none of its tables has, rather than half-qualifying it. - Stripping `snapshots.` from `snapshots.current_date` left the CURRENT_DATE function. Export now checks that its result reads as many columns as the original, quotes such a name the dialect's way when it does not, and otherwise keeps the original. Real Solid exports are otherwise unchanged; the README's count of cross-table metrics left unqualified is corrected to three of six. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): export a field over another column as that column A field whose expression reads a different column (`cust` over `customer_id`) was exported as a Solid column named after the field, a column the warehouse does not have, and the primary key, join keys and metric formulas that named the field pointed at it too. A Solid column is the catalog column, so export now names the column, keeps the field's name as a synonym, with a warning, and rewrites the key, joins and metric references to the column. The README had left this as a product call; the reviewer raised it on the LookML converter, and 5 of the 20 other converters' fixtures hit it. An alias for a column another field already is gets dropped, and its references read the column. On Snowflake and in ANSI SQL a quoted name is case-sensitive, but a field `amount` over `"Amount"` was taken as a plain reference to its own column. A quoted name now matches only as the dialect folds the bare one (`"AMOUNT"` is `amount`; `"Amount"` is an alias). An untyped computed field became a table-scoped metric whenever the model marked its dimensions, which the spec's own `is_time: false` opt-out does, so `customer_name := first_name || ' ' || last_name` (and a primary key over another column) came out as metrics. Without a stashed role, only an aggregate expression is one now; a scalar is a computed column, reported as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): make every key, join and table name resolve Keys and join columns name fields (apache/ossie#486), which the spec's validator enforces since #649, ignoring case. Import copied a Solid table's primary key and join keys as they were, so a key or join on a column the table does not list produced a model the validator rejects. Each such column is now declared as a field, with a warning, and marked so export leaves it out again; every real Solid export and fixture still validates. Export passed a primary key or join naming an undeclared field (a typo, say) to Solid silently; it is now dropped with a warning. A quoted `source` was copied into the Solid table name, quotes and all (the Holistics fixture's `` `ecommerce`.`order_items` ``). It is now the unquoted `catalog.schema.table` Solid uses, and a source with fewer parts is reported, since Solid could not find it in the warehouse. Two datasets over one table (a date table joined twice under two names) exported two Solid tables with the same name, which Solid cannot hold and import rejects. They now become one table, the second's columns merged in, with a warning; both relationships are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(interop): register the Solid converter in the interop matrix The matrix (#62) requires every top-level converter project to be registered (test_committed_manifest_registers_all_converter_projects), so solid/pyproject.toml would fail it. Solid is registered as a file-format converter with import, export and re-import, using its TPC-DS and orders fixtures, and the workflow now triggers on solid/**. Run locally with `--converters solid`: both Solid fixtures round-trip with no issues, and the canonical TPC-DS and Flights models export as LOSSY, reporting what Solid's format cannot hold (Flights declares no datatypes, so Solid's types are left empty). The harness tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): match alias keys ignoring case, keep an edited declared key column Two gaps in the previous commits, found reviewing them before pushing. Keys and join columns were checked against the declared fields ignoring case, as the spec's validator does, but mapped to an alias field's column by exact name, so `primary_key: [CUST]` over the field `cust` (reading `customer_id`) exported as `CUST`, a column that does not exist. Both now match the same way. A key or join column import declares as a field, because the Solid table does not list it, was left out on export unconditionally. That broke the rule every other stashed value follows: the stash stands in for a value only while it is unchanged. Once such a field is given a description, a datatype or anything else in Apache Ossie, it is a column someone described, and it is exported as one, with a warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): carry keys Solid adds later through the round trip Import dropped any key the converter does not map, with a warning. When solid-server added four keys in October, every current export stopped round-tripping until the converter was updated, and the next key it adds would do the same. A key the converter does not map is now carried unchanged in the stash of the object it was on (the document, the model, business_context, a table, a column, a metric, a relationship or its join_keys) and restored there on export. Nothing in Apache Ossie stands in for it, so it is always restored. It is still reported, since an Apache Ossie consumer cannot see it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): one rule for raising or warning, applied in both directions Whether bad input failed the conversion or only dropped the part that was bad depended on where it was found: a relationship to an undeclared dataset raised on export, while import dropped the same thing with a warning, and one metric written only in DAX failed a whole model that Hex and Omni would convert without it. The README now states one rule: raise when the input cannot be read as a whole (not well-formed, names ambiguous, or nothing convertible left); otherwise drop the one construct with a warning and convert the rest. Applying it: - a relationship to an undeclared dataset, or one whose columns do not pair up, is dropped with a warning in both directions; - a field or metric with no SQL Solid can run is dropped with a warning, and so is a key or join naming such a field; a model where no field is left raises up front, with one message rather than a warning per field. Sweeping the other converters' non-SQL fixtures, now that they convert, found two older bugs, both fixed here: - a local list of dropped annotation parts shadowed the dropped datasets inside the relationship loop, so only the first relationship was checked against them; a later one to a query-backed dataset was exported naming the SQL as its table (the ThoughtSpot fixture); - a query source was recognized only in the model's own dialect, so Holistics' `` select * from `ecommerce`.`users` `` was taken as a table name. It is now read in each dialect in turn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(solid): pin against a copy of the spec example; add ConversionWarning The suite pinned exact warning counts and names against the spec's own examples/tpcds_semantic_model.yaml, read from the `ossie` submodule, and this CI runs on every bump of it. An upstream edit as small as a new field without a datatype failed the suite with the converter unchanged (checked by editing the example in place). The pinned tests now read a copy in the fixtures, noting the spec commit it came from, and one test checks the live example loosely: it still converts both ways and re-imports schema-valid. What a conversion loses was reported only as plain UserWarnings, which a library caller could not tell from other warnings and, under Python's default filter, would see once per process. They are now a ConversionWarning, exported with ConversionError, and the README shows how to collect them on every call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(solid): state the guarantees, and check them on generated models The README promised the converter "never drops information silently or produces an invalid result", which was not exactly true: a metric that cannot be qualified safely is left as written, and a unique key equal to the primary key is dropped without a word. It now has a Guarantees section of five statements, each one checked by the suite, with the exceptions named rather than left for a reader to find. The first, that Solid -> Apache Ossie -> Solid gives the same model back, rested on three fixtures and the real exports. test_generated_roundtrip.py checks it, and that import's output is schema-valid with every key and join column a declared field, on 300 seeded models generated the way solid-server's template writes them: every warehouse's type vocabulary, keyword and mixed-case names, composite keys, keys and joins on columns a table does not list, cross-table metrics, table-scoped metric facts and keys a later solid-server might add. Against the code before this round of fixes, 64 of those models fail; against the head of the pull request before round 5, 244 do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): export only what Solid's YAML import accepts Solid can now read its own YAML export back in, and that import rejects a whole model unless it names a `source_system`, and unless every table, column, key column and join column it names is in the warehouse catalog. Export met neither for a model that did not come from Solid: - It never wrote `source_system`, which only a SOLID stash carried. A model not from Solid now gets the one its dialect names (`snowflake`, `databricks`, `big_query`). One in portable SQL names no warehouse, so it gets none, with a warning saying to pass --dialect. A model that came from Solid keeps what its export had, even none, so the round trip of an export from before the key existed is unchanged. - A computed field (`first_name || ' ' || last_name`) was written as a column under the field's name with its expression dropped, naming a column no catalog has. It is now dropped with a warning, like a field in a language Solid cannot run, together with the keys, joins and metrics that read it. A metric reading such a field was not checked before at all. A field that came from a Solid column stays a column whatever its expression has become, as before: the catalog has it. Checked with solid-server's own import code run against a stand-in catalog of the columns each model reads: of the other converters' fixtures, 7 of 17 were rejected for a computed column even with `source_system` added by hand, and all import now. A Solid export round-tripped through Apache Ossie gives the same import draft as the export itself. The generated round-trip test now also exports each of its 300 models with the stash removed and checks the result against the import's rules; against the code before this change every one fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(solid): leave a column free when the field named for it reads another A field over another column (`cust` reading `customer_id`) exports that column, with its own name as a synonym, and a second field over the same column is dropped so Solid lists the column once. Which columns are taken was seeded with every field's own name, which assumed each field exports a column of that name. A field over another column never does: `customer_id` reading `legacy_id` exports `legacy_id`. With both in one dataset, `cust` was dropped with a warning that another field already exports `customer_id`, which none did, and the Solid table lost the `customer_id` column. The seed now leaves out fields over another column, decided as _convert_field decides it. Metric formulas were already right; the column and the false warning were the defect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(solid): align the setup-uv pin with the other converters Every other workflow pins astral-sh/setup-uv v10.3.3; this one was still on v10.3.2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(solid): fix a README count, drop internal ticket numbers from a test The format-level list under Future effort has three entries, not two. A test docstring named Solid's internal tickets, which mean nothing outside Solid; it now gives the month the export changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(solid): mark the deliberately naive datetime for ruff ruff 0.16 reports DTZ001 on the malformed-input sweep's datetime value. It is naive on purpose: a YAML timestamp with no offset loads as a naive datetime, which is the value kind the sweep feeds the converter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(solid): adapt to ossie 0.3.0.dev0, nonportable_extensions, and issue templates --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: JB Onofré <jb@nanthrax.net>
#764) * docs(core-spec): extract dialect/tool function mappings to extensions/ core-spec/expression_language.md still had two blocks of vendor-specific mapping content: "Common Dialect Variations" (ANSI_SQL vs Snowflake, BigQuery, Databricks, PostgreSQL syntax) and "Cross-Reference: Tool Mappings" (Ossie functions vs Tableau, Looker Studio, DAX, and Sigma, across aggregation, date, string, conditional, and window functions). Per #617's vendor-neutral core spec principle, this kind of per-tool reference belongs in extensions/, not in the normative spec. Moves both blocks verbatim into a new extensions/function_mappings.md, replacing them in expression_language.md with a pointer. Lists the new file in extensions/README.md's contents table. No other file referenced the moved section headings, so this does not break any cross-reference. Closes #641. * docs(core-spec): move remaining vendor references to function_mappings Address review on #764: - Overview: state that the document defines the portable Ossie dialect and point to Dialect-Specific Extensions for non-portable dialects - Standards Reference: drop the list of specific databases - Approximate aggregates: move the engine support table and BigQuery note - Function-mapping pointer: neutral wording without vendor names - NULL placement: move the native-defaults table and engine examples - References: keep SQL:2003; move vendor and BI-tool references Editorial and non-normative only, so no docs/spec_changes.md entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(core-spec): move the remaining vendor references to function_mappings Address review on #764: - Overview: link to Dialect Extensions, which explains how dialects are declared and chosen - Date formatting: keep the portable token table in the core spec and move the strftime and Java/LDML columns, and the Oracle examples, to a Datetime Format Tokens section in extensions/function_mappings.md - Numeric semantics: replace the PostgreSQL ROUND example with a neutral one and move it to a Rounding section in function_mappings.md The core spec now names no vendors outside the working-group table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Ashwin Kumar <ashwin.ramesh.kumar@dell.com> Co-authored-by: Ashwin Kumar <ashwinkumar@Ashwins-MacBook-Air.local> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Context
Discussion for this PR is in this thread: https://lists.apache.org/thread.html/vmgv5ffryw70wxbvtwnohhhz2zzx0ocf
Ossie is a vendor-neutral specification. Its extensibility model already reflects
this: a
custom_extensionsentry pairs a free-formvendor_namewith a singleopaque
datastring. A vendor or an individual can attach any amount of extrastate, but that state is cordoned into one opaque value rather than promoted to
top-level spec fields. The core stays small and vendor-neutral, and everything
vendor-specific is opaque payload that the core carries but does not interpret.
Expressions are the one place where this principle is not yet applied. This PR
extends the same pattern to expressions and dialects. It is a spec-level change;
see the mailing-list threads under Related Issues.
1. Make the portable Ossie expression the primary field (backward-compatible)
Today an expression is a list of
dialects, each a{dialect, expression}pair.Ossie defines one portable dialect,
OSSIE_SQL_2026(
core-spec/expression_language.md), but in practice it sits as just anotherentry in the
dialectslist, peer to vendor dialects.This is the only place in the spec where an Ossie concept and a vendor
concept appear at the same level, and the portable form is rarely authored as a
result (there are some workstreams in flight to close this gap).
This PR adds an optional top-level
sqlfield to the expression object. Itis the primary, portable
OSSIE_SQL_2026. Thedialectslistremains for vendor-specific variants. When both the top-level
sqland anOSSIE_SQL_2026entry indialectsare present, the top-level field isauthoritative. For portable-only expressions, this leads to a more concise representation
since the dialect sections / dialect type string can be dropped.
The field is optional and additive, so the change is backward-compatible: existing
documents remain valid.
Note: a prior iteration had the nesting as expression: expression: to stay consistent with the (dialect, expression) pair but the feedback on the thread from @jochenchrist pointed to the double-key nesting feeling wrong
2. Make
dialecta free-form string, not an enumdialectis currently a closed enum incore-spec/ossie-schema.json. Adding adialect requires a change to the core spec and a DISCUSS thread, and a dialect
outside the enum fails validation by default, so an outside party cannot register
its own dialect without a full spec change. Yet these dialects are explicitly
opaque: an implementation MAY ignore any non-
OSSIE_SQL_2026dialect, andregistering a dialect does not imply Ossie can query it.
vendor_nameis already a free-form string for exactly these reasons. This PRapplies the same decoupling to
dialect: enum to free-form string. One could arguedialects belong entirely in
custom_extensions, but expressions are fundamentalenough to keep as a first-class field; only the closed enumeration is removed.
Examples: expression portability before / after this PR
sqlmeans "not portable."FakeDBis not in the enum; valid only after editingcore-spec/spec.yamland regenerating the SDK types.extensions/dialects.md(docs only).Rows 1–3 are additive: every existing document stays valid and
dialectskeeps working. Row 4 is the new capability, mirroring how
vendor_namealready works for
custom_extensions.Why this matters
Together, the future shape is an expression whose primary, portable form is defined
once at the top level, with dialects as optional overrides. The Hex converter calls
out the variety of expression types: not every dialect is a SQL dialect - some are richer
expression languages. More broadly, there is no reason an expression could not be a
code snippet or any other evaluation detail. A closed enum is too restrictive for
that range; a free-form string is not.
Extensions registry
The dialect and vendor example constants move out of the normative spec into a new
top-level
extensions/folder (README.md,dialects.md,vendors.md). This is acommunity registry of well-known tokens: a place to align on their spelling and
meaning without making any token fundamental to the spec. Presence in a list does
not imply endorsement, and new tokens can be added without a full spec review.
Changes in this PR
core-spec/ossie-schema.json:Dialectbecomestype: stringwith illustrativeexamplesand noenum;Vendorexamples are genericized; theExpressionobject gains the optional (Ossie)
sqlfield with its precedence rule.core-spec/spec.md,spec.yaml,expression_language.md: document the free-formdialect, the portable
sqlfield, and the link toextensions/; theopaque / declaration-only text is retained.
extensions/: newREADME.md,dialects.md,vendors.md.scripts/generate-spec-types.py: no longer generates adialectsenumeration(dialects are free-form, like vendors); it still syncs
datatypes.python/SDK:OssieDialectExpression.dialectis typedstr;OssieExpressiongains the optional
sql;OssieDialect/OssieVendorremain asconvenience constants.
validation/validate.py: an unregistered dialect is treated as opaque and skipped (with a warning)rather than parsed as ANSI SQL; the portable
sqlis validated asOSSIE_SQL_2026.validation/validate.py: cleanup on validation to extract dialect logic as an iterator / incorporate feat(core-spec): support dataset-scoped metrics #591.examples/tpcds_semantic_model.yaml: demonstrates the portable ossiesqlfield.Scope and follow-ups
The scope is deliberately minimal. The following refinements are left for follow-up
PRs:
core — into the converters or a shared mixins package — rather than living
alongside the core models. This can be done incrementally.
OSSIE_SQL_2026reading logic should be generalized to bias toward the primarytop-level
sqlwhen it is defined. This PR documents that precedence in thespec and the reference validator honors it, but the converters are not yet updated
to read the field.
Related Issues
Checklist
Specification
core-spec/and follow the existing structuredialectfield type changed from an enum tostr)Ontology
ontology/are consistent with spec changes (N/A — no ontology changes)Converters
Validation
validation/are updated if the spec changedDocumentation
docs/is updated to reflect any user-facing changes (follow-up; see Scope)core-spec/andexamples/)CONTRIBUTING.mdis updated if the contribution process changed (N/A)Examples
examples/are added or updated for any new spec constructs or converter support. Examples in the spec and updated a store sampleTests
pytest/ CI green)Compliance
NOTICEand/orLICENSEhave been updated per ASF policy (N/A — no vendored third-party source)