Skip to content

docs(core-spec): extract dialect/tool function mappings to extensions/ - #764

Open
ashlearnnext-star wants to merge 1 commit into
apache:mainfrom
ashlearnnext-star:fix-issue-641
Open

ashlearnnext-star wants to merge 1 commit into
apache:mainfrom
ashlearnnext-star:fix-issue-641

Conversation

@ashlearnnext-star

Copy link
Copy Markdown
Contributor

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.

Summary

Related Issues

Checklist

Specification

  • Spec changes are included in core-spec/ and follow the existing structure
  • Spec changes have a [DISCUSS] thread on dev@ with a stated end date, and reach lazy consensus (or pass a [VOTE]) before merge
  • Breaking changes to the spec are clearly called out in the summary
  • For a material spec change, docs/spec_changes.md records rationale, compatibility and migration impact, or the PR explains why no entry is needed

Ontology

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

Converters

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

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
  • New third-party dependencies follow Third-Party Dependencies
  • If third-party source code is vendored/copied (not just declared as a dependency), NOTICE and/or LICENSE have been updated per ASF policy

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 apache#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 apache#641.
@github-actions github-actions Bot added the spec label Nov 18, 2026
@ashlearnnext-star
ashlearnnext-star marked this pull request as ready for review November 18, 2026 19:10

@christianeu-db christianeu-db 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.

Thanks for this cleanup @ashlearnnext-star, this is an important step towards continued vendor neutrality!

Beyond the comments, one thing to under overview is to call out this doc is focused on a portable Ossie dialect. It's also possible to carry along non-portable dialects. For more info on how they fit into the spec and can be mapped from the portable dialect, see

Comment on lines 840 to 846
- [Tableau Functions Reference](https://help.tableau.com/current/pro/desktop/en-us/functions.htm)
- [Looker Studio Function List](https://support.google.com/looker-studio/table/6379764)
- [DAX Function Reference](https://learn.microsoft.com/en-us/dax/dax-function-reference)
- [Snowflake SQL Reference](https://docs.snowflake.com/en/sql-reference-functions)
- [BigQuery Standard SQL Reference](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators)
- [Databricks SQL Functions](https://docs.databricks.com/sql/language-manual/sql-ref-functions.html)
- [PostgreSQL Functions](https://www.postgresql.org/docs/current/functions.html)

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.

can these vendor references be moved as well (SQL standard above is fine since it's the basis of Ossie SQL)

Comment on lines 795 to 803
Native defaults:

| Engine | `NULLS FIRST`, `NULLS LAST` | Native `ASC` | Native `DESC` |
| :---- | :---- | :---- | :---- |
| Oracle, PostgreSQL, Redshift, Snowflake | yes | NULLS LAST | NULLS FIRST |
| BigQuery, Databricks | yes | NULLS FIRST | NULLS LAST |
| ClickHouse, DuckDB, Trino | yes | NULLS LAST | NULLS LAST |
| MySQL, SQL Server | no | NULLS FIRST | NULLS LAST |

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.

These should also be extracted

Comment on lines 227 to 234
**Database Support:**

| Function | Snowflake | BigQuery | Databricks | PostgreSQL |
| :---- | :---- | :---- | :---- | :---- |
| `APPROX_COUNT_DISTINCT` | ✅ | ✅ | ✅ | ❌ (extension) |
| `APPROX_PERCENTILE` | ✅ | ✅ `APPROX_QUANTILES` | ✅ | ❌ |

**Note**: BigQuery uses `APPROX_QUANTILES(expr, num_buckets)` which returns an array. To get a specific percentile: `APPROX_QUANTILES(amount, 100)[OFFSET(50)]` for median.

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.

This should be extracted


The core language is based on **ANSI SQL:2003 Core** (ISO/IEC 9075-2:2003), selected for its:

- Wide adoption across major databases (Snowflake, Databricks, PostgreSQL, BigQuery)

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.

perhaps should drop the list of specific databases here as well

Comment on lines +777 to +779
For a non-normative mapping of common functions across popular SQL dialects
(Snowflake, BigQuery, Databricks, PostgreSQL) and BI tools (Tableau, Looker
Studio, DAX, Sigma), see [extensions/function_mappings.md](../extensions/function_mappings.md).

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.

Let's not name specific vendors here or state popular. Maybe something like:

For a non-normative mapping of common functions across popular SQL dialects and other expression languages, see ...

| Null coalesce | `COALESCE(a, b)` | `COALESCE(a, b)` or `NVL(a, b)` | `COALESCE(a, b)` or `IFNULL(a, b)` | `COALESCE(a, b)` | `COALESCE(a, b)` |
| Current timestamp | `CURRENT_TIMESTAMP` | `CURRENT_TIMESTAMP()` | `CURRENT_TIMESTAMP()` | `CURRENT_TIMESTAMP()` | `CURRENT_TIMESTAMP` |
| Substring | `SUBSTRING(s, start, len)` | `SUBSTR(s, start, len)` | `SUBSTR(s, start, len)` | `SUBSTRING(s, start, len)` | `SUBSTRING(s, start, len)` |
For a non-normative mapping of common functions across popular SQL dialects

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.

Beyond functions at this point, maybe something:

For a non-normative mapping from the portable Ossie dialect to vendor dialects and expressions, see ...

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract reamining dialect-specific mapping details / references from core-spec into extensions folder

2 participants