Skip to content

feat(core-spec): add TRINO to Dialect enum - #607

Open
MahmoudHassanen99 wants to merge 19 commits into
apache:mainfrom
MahmoudHassanen99:feat/spec-add-trino-dialect
Open

MahmoudHassanen99 wants to merge 19 commits into
apache:mainfrom
MahmoudHassanen99:feat/spec-add-trino-dialect

Conversation

@MahmoudHassanen99

@MahmoudHassanen99 MahmoudHassanen99 commented Oct 18, 2026 •

Copy link
Copy Markdown

Summary

Registers TRINO in the core-spec Dialect enum across all core specification and model mapping files.

Updated Files:

  • core-spec/spec.md
  • core-spec/ossie-schema.json
  • core-spec/spec.yaml
  • python/src/ossie/models.py
  • scripts/generate_spec_types.py

Note on validate.py

Per discussion on dev@, added to validate.py

Checklist

Specification

  • Spec changes are included in core-spec/ and follow the existing structure
  • Spec changes have been discussed on the mailing list or in a linked issue
  • Breaking changes to the spec are clearly called out in the summary

Ontology

  • Ontology changes in ontology/ are consistent with spec changes
  • New or modified terms are defined and documented

Converters

  • Converter logic in converters/ is updated to reflect spec or ontology changes
  • New converters include tests under the converter's test directory
  • If adding a new converter, .github/labeler.yml is updated with the new path

Validation

  • Validation rules in validation/ are updated if the spec changed
  • New validation cases are covered by tests

Documentation

  • docs/ is updated to reflect any user-facing changes
  • New features or behaviors are documented with examples where appropriate
  • CONTRIBUTING.md is updated if the contribution process changed

Examples

  • examples/ are added or updated for any new spec constructs or converter support

Tests

  • [] All existing tests pass (pytest / CI green)
  • [] New functionality is covered by tests

Compliance

  • ASF license headers are present on all new source files
  • No third-party dependencies are added without PMC/IPMC approval
  • If third-party source code is vendored/copied (not just declared as a dependency), NOTICE and/or LICENSE have been updated per ASF policy

@github-actions github-actions Bot added the spec label Oct 18, 2026

@kayemkim kayemkim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

converter-hex-ci runs on a python/** change, and with this branch merged onto current main (53418ba) its tests/cli/test_cli_export.py::test_invalid_dialect fails: the --dialect choices are built from OssieDialect, so the snapshot now ends in ossie_sql_2026, trino. The same enum drives _to_sqlglot_dialect in load_ossie_dialect_expression.py, which ends in assert_never, so ossie-hex export of a document with a TRINO expression stops with Expected code to be unreachable, but got: <OssieDialect.TRINO: 'TRINO'>, where main rejects that document at load. Hex's own dialect names include trino and its vendored sqlglot has SQLGlotDialect.TRINO, so this is OssieDialect.TRINO: "trino" in _DIALECT_NAME_MAP, a TRINO branch in _to_sqlglot_dialect, a row in test_convert_ossie_dialect.py and the snapshot update, which is what #598 did for POSTGRES and REDSHIFT.

The Holistics converter keeps SQLGLOT_DIALECT in sqlrefs.py, which its comment says mirrors DIALECT_MAP, and JB asked #598 to carry its dialects there in the same PR. Without "TRINO": "trino" a Trino body is read with sqlglot's default reader and trino is missing from the --sql-dialect choices. Its suite passes either way, 92 passed here. #598 also added the new names to converters/holistics/docs/limitations.md.

The hex snapshot applies to #558 as well, since CLICKHOUSE joins OssieDialect there too and hex has a clickhouse dialect name.

@kayemkim

Copy link
Copy Markdown
Contributor

A note on the Holistics part above: #612 adds a test that compares SQLGLOT_DIALECT in sqlrefs.py with the schema enum, and JB plans to merge it first, so this branch will fail that test on rebase until "TRINO": "trino" is in the table. DIALECT_MAP is already right here.

@MahmoudHassanen99

Copy link
Copy Markdown
Author

Hi @kayemkim,

Thanks a lot for the detailed guidance and review! I really appreciate you pointing these out.

I have updated the branch to cover all downstream requirements across the Hex and Holistics converters:

  1. Hex Converter: Added OssieDialect.TRINO: "trino" to _DIALECT_NAME_MAP, added the TRINO branch in _to_sqlglot_dialect, updated test_convert_ossie_dialect.py, and updated the --dialect CLI choices snapshot in test_cli_export.py.
  2. Holistics Converter: Added "TRINO": "trino" to SQLGLOT_DIALECT in sqlrefs.py and updated converters/holistics/docs/limitations.md.
  3. Validation & Spec: Added "TRINO": "trino" to DIALECT_MAP in validation/validate.py and updated the core spec files.

I am very grateful for your help on this. Please let me know if any further changes or refinements are needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants