Repository navigation
fix(salesforce): read OSSIE_SQL_2026 metric expressions - #513
Conversation
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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
LGTM. I reviewed the surrounding dialect handling in SqlMetricExpressionParser and MetricExpressionTranslator.
OSSIE_SQL_2026is added afterTABLEAU,SNOWFLAKEandANSI_SQLinDIALECTS. 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, whileANSI_SQLandTABLEAUkeep accepting it. - The
IFNULL,ISNULL,CEILINGandCOUNTDaliases stayTABLEAU-only, soOSSIE_SQL_2026behaves likeANSI_SQL, as the README says. - The tests cover preference order, bracket rejection, double-quoted identifiers, and every SQL dialect against the shared expression cases.
Summary
#439 added
OSSIE_SQL_2026to the core spec. The Salesforce converter never learnedit:
MetricExpressionTranslator.DIALECTSlists onlyTABLEAU,SNOWFLAKEandANSI_SQL, so a metric written in the portable dialect aborts the whole conversionrather than being dropped — on
main, this model produces no output file at all andthe valid
TABLEAUmetric next to it is lost too:OSSIE_SQL_2026is ANSI-SQL-based, so it joins the chain last —TABLEAU,SNOWFLAKE,ANSI_SQL,OSSIE_SQL_2026— and a vendor dialect still wins when bothare present. It then parses on exactly the
ANSI_SQLpath, so the supported functionsubset is unchanged; the spec's
IFNULL/NVL/CEILINGaliases stay outside it.Identifier quoting follows
expression_language.md: the Ossie dialect's quotecharacter is the ANSI double quote, so
SUM("ORDERS"."PROFIT")compiles toSUM([orders].[profit]). Bracket notation remains accepted only forTABLEAUand, asa documented compatibility case,
ANSI_SQL— behaviour for existing dialects isunchanged.
Calculated fields are out of scope:
FieldMappingHandler.java:302drops those forevery non-
TABLEAUdialect, which predates this dialect and is a separate gap.Verification
mvn -B clean verifyinconverters/salesforce: 289 tests, 0 failures, 0 errors,0 skipped, with the Salesforce schema installed per the README.
schema-gated skips.
translatedComposedMetricsValidateAgainstTheSalesforceSchemafail when the main-codechange is reverted.
201and/validatereturnsisValid: truewith no validation errors — both for ahand-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
SNOWFLAKEandANSI_SQLtranslation.Checklist
Sections this change does not touch (Specification, Ontology, Validation, Examples)
are omitted rather than left unchecked.
Converters
converters/salesforce/README.mddocuments the selectionorder, the quoting rule and the aliases that stay unsupported
Tests
Compliance