Skip to content

docs: move dialect mappings to extensions - #644

Closed
arnavshah038-jpg wants to merge 3 commits into
apache:mainfrom
arnavshah038-jpg:fix/641-extract-dialect-details
Closed

arnavshah038-jpg wants to merge 3 commits into
apache:mainfrom
arnavshah038-jpg:fix/641-extract-dialect-details

Conversation

@arnavshah038-jpg

@arnavshah038-jpg arnavshah038-jpg commented Oct 26, 2026 •

Copy link
Copy Markdown

Summary

Move database function support details from the core specification into extensions/tool-mappings.md.

Move dialect-specific variations and BI-tool function mappings into the extensions documentation.

Keep the core specification focused on portable expression language requirements.

Related Issues

Closes #641

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

Validation

git diff --check passed locally.

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
  • 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

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!

@github-actions github-actions Bot added the spec label Oct 26, 2026
@jbonofre
jbonofre self-requested a review October 26, 2026 10:20
Comment thread extensions/tool-mappings.md Resolved
Comment thread extensions/tool-mappings.md Outdated

This document contains non-normative dialect-specific examples and BI-tool function mappings. These tables are references, not requirements for the portable core expression language.

### Common Dialect Variations

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.

After the # title, the file jumps directly to ###.

Can you please verify the headings here? It looks not well aligned.

Comment thread extensions/tool-mappings.md Resolved
Comment thread extensions/tool-mappings.md Resolved
APPROX_PERCENTILE(response_time, 0.95)
```

**Database Support:**

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.

Removing the support table means this section no longer says anything about portability.

The BigQuery difference (APPROX_QUANTILES returns an array) affects whether these functions are portable.

Could you add one line pointer here, such as "See Dialect and Tool Mappings for per database support"?
The "Database Function Support" section in the new file also needs a proper heading instead of the bold **Database Support:** label.

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 one is still open imho. The section doesn't point to the moved support table yet.

I suggest something like:

Suggested change
**Database Support:**
See [Database Function Support](../extensions/tool-mappings.md#database-function-support) for per-database support of these functions.
### Conditional Aggregations (REQUIRED)

@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 again for the contribution! @arnavshah038-jpg , do you mind rebasing and taking another look at the review feedback when you get a chance? It would be great to keep this moving toward merge.

@arnavshah038-jpg
arnavshah038-jpg force-pushed the fix/641-extract-dialect-details branch from 6e56988 to 07c3fe8 Compare November 2, 2026 14:55

@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 @arnavshah038-jpg! One inline comment on the Sigma rows, which should be fixed before merging. @jbonofre, could you take another look at your change request once that's in?

Comment on lines +116 to +119
| `CASE WHEN...` | `CASE WHEN...` or `IF...` | `CASE WHEN...` | `SWITCH(TRUE(), ...)` | Only 3-argument `If(cond, t, f)`; no native multi-branch `CASE` |
| `IF(cond, t, f)` | `IF cond THEN t ELSE f END` | N/A (use CASE) | `IF(cond, t, f)` | `If(cond, t, f)` |
| `COALESCE(a, b)` | `IFNULL(a, b)` or `ZN(a)` | `COALESCE(...)` | `COALESCE(a, b)` | `IfNull(a, b)` (2-argument only) |
| `NULLIF(a, b)` | `IF a = b THEN NULL ELSE a END` | N/A | `IF(a = b, BLANK(), a)` | `If(a = b, Null(), a)` |

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.

The Sigma cells for CASE WHEN... and NULLIF are the values from before #660, which corrected them on main. The move would bring back "no native multi-branch CASE" and If(a = b, Null(), a) in place of the variadic If(...) and NullIf(a, b). Could we carry over the current rows?

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.

I guess we have to get the current row onto main:

Suggested change
| `CASE WHEN...` | `CASE WHEN...` or `IF...` | `CASE WHEN...` | `SWITCH(TRUE(), ...)` | Only 3-argument `If(cond, t, f)`; no native multi-branch `CASE` |
| `IF(cond, t, f)` | `IF cond THEN t ELSE f END` | N/A (use CASE) | `IF(cond, t, f)` | `If(cond, t, f)` |
| `COALESCE(a, b)` | `IFNULL(a, b)` or `ZN(a)` | `COALESCE(...)` | `COALESCE(a, b)` | `IfNull(a, b)` (2-argument only) |
| `NULLIF(a, b)` | `IF a = b THEN NULL ELSE a END` | N/A | `IF(a = b, BLANK(), a)` | `If(a = b, Null(), a)` |
| `CASE WHEN...` | ... | `If(c1, v1, c2, v2, ..., else)` (variadic; else is optional and defaults to Null) |
| `IF(cond, t, f)` | ... (unchanged) |
| `COALESCE(a, b)` | ... (unchanged) |
| `NULLIF(a, b)` | ... | `NullIf(a, b)` |

@jbonofre
jbonofre self-requested a review November 17, 2026 04:19

@jbonofre jbonofre left a comment

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.

Thanks for the update. ASF header, the headings and the extensions/README.md entry look good now.

Imho, the Sigma CASE WHEN ... and NULLIF rows need the current values from main.
Also the Approximate Aggregations section still needs the pointer to the moved support table.

The PR should be rebase with resolved conflicts as well.

I'm happy to do that.

Comment on lines +116 to +119
| `CASE WHEN...` | `CASE WHEN...` or `IF...` | `CASE WHEN...` | `SWITCH(TRUE(), ...)` | Only 3-argument `If(cond, t, f)`; no native multi-branch `CASE` |
| `IF(cond, t, f)` | `IF cond THEN t ELSE f END` | N/A (use CASE) | `IF(cond, t, f)` | `If(cond, t, f)` |
| `COALESCE(a, b)` | `IFNULL(a, b)` or `ZN(a)` | `COALESCE(...)` | `COALESCE(a, b)` | `IfNull(a, b)` (2-argument only) |
| `NULLIF(a, b)` | `IF a = b THEN NULL ELSE a END` | N/A | `IF(a = b, BLANK(), a)` | `If(a = b, Null(), a)` |

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.

I guess we have to get the current row onto main:

Suggested change
| `CASE WHEN...` | `CASE WHEN...` or `IF...` | `CASE WHEN...` | `SWITCH(TRUE(), ...)` | Only 3-argument `If(cond, t, f)`; no native multi-branch `CASE` |
| `IF(cond, t, f)` | `IF cond THEN t ELSE f END` | N/A (use CASE) | `IF(cond, t, f)` | `If(cond, t, f)` |
| `COALESCE(a, b)` | `IFNULL(a, b)` or `ZN(a)` | `COALESCE(...)` | `COALESCE(a, b)` | `IfNull(a, b)` (2-argument only) |
| `NULLIF(a, b)` | `IF a = b THEN NULL ELSE a END` | N/A | `IF(a = b, BLANK(), a)` | `If(a = b, Null(), a)` |
| `CASE WHEN...` | ... | `If(c1, v1, c2, v2, ..., else)` (variadic; else is optional and defaults to Null) |
| `IF(cond, t, f)` | ... (unchanged) |
| `COALESCE(a, b)` | ... (unchanged) |
| `NULLIF(a, b)` | ... | `NullIf(a, b)` |

APPROX_PERCENTILE(response_time, 0.95)
```

**Database Support:**

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 one is still open imho. The section doesn't point to the moved support table yet.

I suggest something like:

Suggested change
**Database Support:**
See [Database Function Support](../extensions/tool-mappings.md#database-function-support) for per-database support of these functions.
### Conditional Aggregations (REQUIRED)

Add ASF license header, fix heading hierarchy, add blank line before separator, list tool-mappings.md in extensions/README.md, and add a portability note to the core spec pointing to the extension docs.
@arnavshah038-jpg
arnavshah038-jpg force-pushed the fix/641-extract-dialect-details branch from 14c7393 to ec378a2 Compare November 25, 2026 04:34
@arnavshah038-jpg

Copy link
Copy Markdown
Author

Thanks for the review! I've addressed all the feedback and rebased onto the latest main (also resolved the conflict in extensions/README.md):

  1. Added the ASF license header to extensions/tool-mappings.md.
  2. Fixed the heading hierarchy (sections after the main # heading now use ##).
  3. Added a blank line before the horizontal separator.
  4. Added tool-mappings.md to the table in extensions/README.md.
  5. "Database Function Support" is a proper heading, not bold text.
  6. Added a portability note to core-spec/expression_language.md saying function support varies by dialect, with a link to the extension docs.
  7. The note uses BigQuery's APPROX_QUANTILES as the example of a dialect difference.

Could you please take another look when you have time?

@christianeu-db

Copy link
Copy Markdown
Contributor

@arnavshah038-jpg ended up merging #764 but flagged you in that PR description as a co-author

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

3 participants