fix(wisdom): read OSSIE_SQL_2026 metric expressions - #449
Conversation
OSSIE_SQL_2026 (core-spec apache#439, Python enum apache#440) is an ANSI-SQL-compatible portable dialect, but the wisdom converter's _pick_expression() fell back only through the dataset dialect and then ANSI_SQL. A field or metric expressed only in OSSIE_SQL_2026 raised a spurious MISSING_DIALECT_EXPRESSION issue, even though the converter still used the first listed expression as a fallback. Add OSSIE_SQL_2026 to the fallback chain, treating it as an ANSI_SQL-equivalent, so an OSSIE_SQL_2026-only field or metric is exported without the spurious issue. Add regression tests covering a field-only and a metric-only OSSIE_SQL_2026 expression, the ANSI_SQL and native-dialect precedence over it, and a genuinely unusable dialect that still reports MISSING_DIALECT_EXPRESSION. Partial fix for apache#442 (wisdom converter only). Co-authored-by: Isaac <no-reply@databricks.com>
kayemkim
left a comment
There was a problem hiding this comment.
Ran it merged into current main through the wisdom CI steps on 3.11 to 3.14: green, 32 tests against 27. On main a field and a metric carrying only OSSIE_SQL_2026 export fine but raise two MISSING_DIALECT_EXPRESSION issues, and on this branch the export is byte-identical with no issues. The fallback order matches what #447 did for snowflake, and it merges with #455 without conflict. LGTM.
jbonofre
left a comment
There was a problem hiding this comment.
LGTM!
Adding OSSIE_SQL_2026 as a fallback after the native dialect and ANSI_SQL is right.
The lookup order is covered by the new tests, including the no-match case that still reports MISSING_DIALECT_EXPRESSION. Great work!
One note, non-blocking: expressions that exist only in OSSIE_SQL_2026 now convert without any warning, so the output SQL may not be valid on the target dialect. That seems like the intended tradeoff here, but it may be worth documenting.
Summary
#439 added
OSSIE_SQL_2026to the core spec and #440 added it to the PythonOssieDialectenum. This PR adds awareness to the wisdom converter._pick_expression()fell back only through the dataset dialect and thenANSI_SQL, so a field or metric expressed solely inOSSIE_SQL_2026raised aspurious
MISSING_DIALECT_EXPRESSIONissue.OSSIE_SQL_2026is ANSI-SQL-compatible, so this treats it as anANSI_SQL-equivalent fallback:ossie_to_wisdom.pyadds anOSSIE_SQL_2026branch to_pick_expression(),so an
OSSIE_SQL_2026-only field or metric is exported without the spuriousissue.
OSSIE_SQL_2026expression, the
ANSI_SQLand native-dialect precedence over it, and agenuinely unusable dialect that still reports
MISSING_DIALECT_EXPRESSION._infer_dataset_dialect()needs no change: likeANSI_SQL,OSSIE_SQL_2026isnot a native connection dialect, so a dataset expressed only in it already
resolves to the ANSI-compatible connection.
wisdom_to_ossie.pyonly writes theconnection's own dialect on the way out, so the reverse direction is untouched.
This is a partial fix. #442 lists five call sites across the converters and
validation; databricks (#446), orionbelt (#443), and snowflake (#447) are
merged, and this one covers the wisdom converter.
Related Issues
Part of #442.
Checklist
Sections that this change does not touch (Specification, Ontology, Validation,
Documentation, Examples) are left unchecked.
Converters
converters/is updated to reflect spec or ontology changesTests
pytest/ CI green)Compliance