Repository navigation
docs(core-spec): extract dialect/tool function mappings to extensions/ - #764
ashlearnnext-star wants to merge 1 commit into
Conversation
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.
christianeu-db
left a comment
There was a problem hiding this comment.
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
| - [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) |
There was a problem hiding this comment.
can these vendor references be moved as well (SQL standard above is fine since it's the basis of Ossie SQL)
| 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 | | ||
|
|
There was a problem hiding this comment.
These should also be extracted
| **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. |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
perhaps should drop the list of specific databases here as well
| 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). |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Beyond functions at this point, maybe something:
For a non-normative mapping from the portable Ossie dialect to vendor dialects and expressions, see ...
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
core-spec/and follow the existing structure[DISCUSS]thread ondev@with a stated end date, and reach lazy consensus (or pass a[VOTE]) before mergedocs/spec_changes.mdrecords rationale, compatibility and migration impact, or the PR explains why no entry is neededOntology
ontology/are consistent with spec changesConverters
Validation
validation/are updated if the spec changedDocumentation
docs/is updated to reflect any user-facing changesCONTRIBUTING.mdis updated if the contribution process changedExamples
examples/are added or updated for any new spec constructsTests
pytest/ CI green)Compliance
NOTICEand/orLICENSEhave been updated per ASF policy