Skip to content

fix(salesforce): read OSSIE_SQL_2026 metric expressions - #513

Merged
jbonofre merged 1 commit into
apache:mainfrom
RyutoYoda:fix/salesforce-ossie-sql-2026
Oct 6, 2026
Merged

jbonofre merged 1 commit into
apache:mainfrom
RyutoYoda:fix/salesforce-ossie-sql-2026

Conversation

@RyutoYoda

Copy link
Copy Markdown
Contributor

Summary

#439 added OSSIE_SQL_2026 to the core spec. The Salesforce converter never learned
it: MetricExpressionTranslator.DIALECTS lists only TABLEAU, SNOWFLAKE and
ANSI_SQL, so a metric written in the portable dialect aborts the whole conversion
rather than being dropped — on main, this model produces no output file at all and
the valid TABLEAU metric next to it is lost too:

Error: Metric 'portable_only': no supported dialect; provide TABLEAU, SNOWFLAKE or ANSI_SQL
exit 3

OSSIE_SQL_2026 is ANSI-SQL-based, so it joins the chain last — TABLEAU,
SNOWFLAKE, ANSI_SQL, OSSIE_SQL_2026 — and a vendor dialect still wins when both
are present. It then parses on exactly the ANSI_SQL path, so the supported function
subset is unchanged; the spec's IFNULL / NVL / CEILING aliases stay outside it.

Identifier quoting follows expression_language.md: the Ossie dialect's quote
character is the ANSI double quote, so SUM("ORDERS"."PROFIT") compiles to
SUM([orders].[profit]). Bracket notation remains accepted only for TABLEAU and, as
a documented compatibility case, ANSI_SQL — behaviour for existing dialects is
unchanged.

Calculated fields are out of scope: FieldMappingHandler.java:302 drops those for
every non-TABLEAU dialect, which predates this dialect and is a separate gap.

Verification

  • mvn -B clean verify in converters/salesforce: 289 tests, 0 failures, 0 errors,
    0 skipped, with the Salesforce schema installed per the README.
  • Same run without the schema, matching CI: green, with only the 15 pre-existing
    schema-gated skips.
  • The three new translator tests and the portable metric added to
    translatedComposedMetricsValidateAgainstTheSalesforceSchema fail when the main-code
    change is reverted.
  • End-to-end against a live Tableau Next org: the exported model POSTs 201 and
    /validate returns isValid: true with no validation errors — both for a
    hand-written model and for one imported back from an existing org model
    (3 data objects, 43 fields, 2 relationships). Test models were deleted afterwards.

Related Issues

Part of apache/ossie-converters#32 (the Salesforce converter was not listed among the original affected call
sites), following the same pattern as #509.

This touches the translator added in #404. apache/ossie-converters#36 stays open for its author's remaining
milestones; none of them mention this dialect, and its stated scope is SNOWFLAKE and
ANSI_SQL translation.

Checklist

Sections this change does not touch (Specification, Ontology, Validation, Examples)
are omitted rather than left unchecked.

Converters

  • Converter logic updated; converters/salesforce/README.md documents the selection
    order, the quoting rule and the aliases that stay unsupported
  • Tests live under the converter's test directory

Tests

  • All existing tests pass: 289 passed, 0 skipped locally; green on the CI profile
  • New functionality is covered by tests, and they fail without the fix

Compliance

  • ASF license headers present (no new files added)
  • No third-party dependencies added

The converter selected TABLEAU, SNOWFLAKE or ANSI_SQL only, so a metric
authored in the spec's own portable dialect failed conversion with
"no supported dialect" instead of exporting. OSSIE_SQL_2026 is based on
ANSI SQL:2003 Core, so it is parsed and validated on the existing SQL
path and selected last, after an engine-specific dialect.

Identifiers follow the spec: double quotes only. Bracket notation stays a
documented ANSI_SQL compatibility case and is rejected for OSSIE_SQL_2026
with the same hint Snowflake gets.

@kayemkim kayemkim 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.

Ran this merged onto current main (9e87fa3) through the salesforce workflow on JDK 21: 289 tests, 15 skipped without the Salesforce schema, the same as CI. I also built main and this branch and pushed a model through toSF on both. On main a metric carrying only OSSIE_SQL_2026 ends the run with exit 3 and no output file, taking the valid TABLEAU metric next to it down as well. On this branch it exports as SUM([Orders].[amount]), SNOWFLAKE and ANSI_SQL siblings still win over it, and SUM([Orders].[amount]) written under OSSIE_SQL_2026 is rejected with the double-quote hint rather than parsed. Putting the portable dialect last matches #443, #447, #449 and #509, so the series stays in step, and this covers the one converter #442 did not list. No overlap with your #514 either, the two merge cleanly together. Reads right to me.

@jbonofre
jbonofre self-requested a review October 6, 2026 05:36

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

LGTM. I reviewed the surrounding dialect handling in SqlMetricExpressionParser and MetricExpressionTranslator.

  • OSSIE_SQL_2026 is added after TABLEAU, SNOWFLAKE and ANSI_SQL in DIALECTS. The duplicate-entry detection and the error messages are built from the same list, the new dialect is covered.
  • Square-bracket quoting is rejected for OSSIE_SQL_2026, while ANSI_SQL and TABLEAU keep accepting it.
  • The IFNULL, ISNULL, CEILING and COUNTD aliases stay TABLEAU-only, so OSSIE_SQL_2026 behaves like ANSI_SQL, as the README says.
  • The tests cover preference order, bracket rejection, double-quoted identifiers, and every SQL dialect against the shared expression cases.

@jbonofre
jbonofre merged commit 045a64b into apache:main Oct 6, 2026
6 checks passed
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.

3 participants