Skip to content

docs: use portable sql fields in canonical examples - #640

Open
OKAN-SOFTWARE wants to merge 3 commits into
apache:mainfrom
OKAN-SOFTWARE:docs/portable-sql-examples-639
Open

OKAN-SOFTWARE wants to merge 3 commits into
apache:mainfrom
OKAN-SOFTWARE:docs/portable-sql-examples-639

Conversation

@OKAN-SOFTWARE

@OKAN-SOFTWARE OKAN-SOFTWARE commented Oct 26, 2026 •

Copy link
Copy Markdown

Updates canonical examples and documentation to use expression.sql for portable SQL. Preserves SQL expressions, model data, and vendor-specific variants.

Closes #639.

Validation: 537 tests passed locally. All five canonical examples validated. Spec synchronization and diff checks passed. Hosted CI and maintainer review are pending.

@github-actions

Copy link
Copy Markdown

Thank you for your first contribution to Apache Ossie (incubating)!

A committer will review your PR. In the meantime, please ensure:

  • All CI checks pass
  • ASF license headers are present on new source files
  • Tests cover new functionality

No ICLA is required to contribute. If you are elected as a committer in the future, you will need an Individual Contributor License Agreement (ICLA) on file with the ASF.

Questions? Ask in the PR comments or join us on Slack.

We appreciate your contribution!

Comment thread examples/flights.yaml
dialects:
- dialect: ANSI_SQL
expression: airport_code
sql: airport_code

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Moving every example to sql-only means none of the three files CI validates (flights.yaml, flights.semantic_model.yaml, tpcds_semantic_model.yaml) goes through the dialects path any more.
Only the unit tests in validation/tests/test_validate.py still cover it, so a regression in the per-dialect dialect/expression handling would not fail on the examples.

Could we keep at least one dialects entry in the examples, for instance a vendor-specific variant on a single field or metric in flights.yaml?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in commit f46b752. The canonical flights.yaml example now retains a Snowflake-specific dialect expression alongside its portable SQL expression, ensuring the per-dialect validation path remains covered.

Comment thread core-spec/spec.md
### Expression Object

The expression object supports multiple dialects
Use `sql` for the primary, portable metric expression. Optional vendor-specific

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This block is now sql-only, but the text below it says vendor variants can be supplied in dialects, and the field section points to a "multi-dialect example below". No metric example shows that shape.
Someone writing a metric has nothing to copy.

Could we add a metric-level example with sql plus a vendor entry under dialects? That would also fit with keeping one dialects example in the examples files.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in commit 930aeaf. The metric expression documentation now includes a complete example combining portable SQL with a BigQuery-specific SAFE_DIVIDE dialect variant.

@OKAN-SOFTWARE

Copy link
Copy Markdown
Author

Thanks for the detailed review. Both requested changes are included in the latest commits:

  • examples/flights.yaml now retains a portable sql expression alongside a Snowflake-specific dialects entry, preserving coverage of the dialect-validation path (f46b752).
  • core-spec/spec.md now includes a metric example combining portable sql with a BigQuery SAFE_DIVIDE variant (930aeaf).

The updated diff addresses both review points.

The GitHub Actions workflows currently show action_required, so hosted CI validation is still pending. Could a maintainer approve the workflows and re-review the updated PR when convenient?

Happy to address any remaining feedback. Thank you!

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.

Update canonical expression examples to use expression.sql for portable SQL, instead of an item in the dialects list

2 participants