Apache Ossie SQL Dialects: Complete Guide to Expression Language Support

Apache Ossie supports seven SQL dialects—ANSI_SQL, SNOWFLAKE, BIGQUERY, DATABRICKS, MDX, TABLEAU, and MAQL—allowing models to define platform-specific expressions with automatic fallback to ANSI SQL.

Apache Ossie defines a standard enumeration of expression language dialects that implementations use to describe field and metric expressions. This core specification, located in core-spec/spec.yaml, enables cross-platform portability by letting converters select the appropriate dialect for their target platform. Understanding which SQL dialects are supported by Ossie is essential for building portable semantic models that work across different data warehouses and BI tools.

Complete List of SQL Dialects Supported by Ossie

The Ossie specification recognizes seven distinct expression language dialects. Each dialect corresponds to a specific data platform or analytical query language:

  • ANSI_SQL: The baseline, portable SQL dialect defined by the ANSI standard. This serves as the universal fallback when platform-specific dialects are unavailable.
  • SNOWFLAKE: Dialect for Snowflake data warehouses, supporting Snowflake-specific functions and syntax.
  • BIGQUERY: Google BigQuery (GoogleSQL) dialect for Google Cloud data warehouses.
  • DATABRICKS: Databricks SQL dialect optimized for Databricks runtimes.
  • MDX: Microsoft Multi-Dimensional Expressions, used by OLAP tools and multidimensional databases.
  • TABLEAU: Tableau's native expression language for visual analytics.
  • MAQL: GoodData's Multi-Dimensional Analytical Query Language for semantic layer definitions.

These dialects are enumerated in the core specification file [core-spec/spec.yaml](https://github.com/apache/ossie/blob/main/core-spec/spec.yaml#L31-L39) at lines 31-39.

Where Dialects Are Defined in the Source Code

The dialect enumeration resides in the core specification, but documentation and implementation references appear throughout the repository:

  • core-spec/spec.yaml (lines 31-39): Defines the canonical list of supported dialects as an enumeration.
  • docs/index.md (lines 62-66): Documents the list of supported dialects and explains the fallback logic for converters.
  • core-spec/spec.md (lines 75-82): Describes the expression schema with its dialects array structure.
  • core-spec/expression_language.md (lines 31-38): Discusses extensibility and vendor-specific dialect extensions.

According to the Apache Ossie source code, each field or metric can hold multiple dialect-specific expressions. When a converter processes a model, it selects the dialect matching its target platform, falling back to ANSI_SQL if the platform-specific dialect is absent.

How Multi-Dialect Expressions Work

Ossie's expression system allows a single field or metric to contain alternative implementations for different platforms. This multi-dialect approach ensures that a semantic model works correctly whether deployed to Snowflake, BigQuery, or Databricks without requiring separate model files.

Declaring Multiple Dialects in YAML

You define dialect-specific expressions within the dialects array of an expression object. Each entry specifies the dialect name and the corresponding SQL or expression text.

The following example shows a field defining expressions for three different platforms:

fields:
  - name: total_price
    expression:
      dialects:
        - dialect: ANSI_SQL
          expression: "price * quantity"
        - dialect: SNOWFLAKE
          expression: "price * quantity"
        - dialect: BIGQUERY
          expression: "price * quantity"

In this declaration, the total_price field provides the same calculation in ANSI SQL, Snowflake, and BigQuery dialects. A Snowflake converter selects the SNOWFLAKE entry, while a generic processor falls back to ANSI_SQL if no specific match exists.

Metrics follow the same pattern, as demonstrated in this vendor-specific configuration:

metrics:
  - name: profit_margin
    expression:
      dialects:
        - dialect: ANSI_SQL
          expression: "(revenue - cost) / revenue"
        - dialect: DATABRICKS
          expression: "(revenue - cost) / revenue"
        - dialect: MAQL
          expression: "(revenue - cost) / revenue"

Here, the profit_margin metric includes specialized expressions for Databricks deployments and GoodData environments using MAQL.

Implementing Dialect Selection in Python

When consuming Ossie models programmatically, you can implement the fallback logic using the Python SDK. The following snippet demonstrates how to retrieve an expression for a preferred dialect while defaulting to ANSI SQL:

from ossie.models import load_model

model = load_model("my_model.yaml")

def get_expression(field, preferred="SNOWFLAKE"):
    """Request expression for a field, preferring target dialect, falling back to ANSI_SQL."""
    # Search for preferred dialect

    for d in field["expression"]["dialects"]:
        if d["dialect"] == preferred:
            return d["expression"]
    # Fallback to ANSI_SQL

    for d in field["expression"]["dialects"]:
        if d["dialect"] == "ANSI_SQL":
            return d["expression"]
    return None

price_expr = get_expression(model["fields"][0])
print(price_expr)   # → "price * quantity"

This helper function first attempts to return the preferred dialect's expression. If unavailable, it searches for the ANSI_SQL entry, ensuring the model remains functional across different converter implementations.

Summary

  • Apache Ossie supports seven SQL dialects: ANSI_SQL, SNOWFLAKE, BIGQUERY, DATABRICKS, MDX, TABLEAU, and MAQL.
  • The canonical enumeration resides in core-spec/spec.yaml at lines 31-39.
  • Models can define multiple dialect-specific expressions for a single field or metric, enabling cross-platform deployment.
  • Converters implement fallback logic that defaults to ANSI_SQL when platform-specific dialects are not defined.
  • Documentation spans docs/index.md, core-spec/spec.md, and core-spec/expression_language.md, describing both the schema and extensibility mechanisms.

Frequently Asked Questions

What is the default SQL dialect in Apache Ossie?

ANSI_SQL serves as the default and fallback dialect in Apache Ossie. When a converter processes a model and cannot find an expression matching its target platform (such as SNOWFLAKE or BIGQUERY), it automatically falls back to the ANSI_SQL entry. This behavior is documented in docs/index.md lines 62-66 and ensures baseline compatibility across all implementations.

Can I use multiple SQL dialects in a single Ossie model?

Yes, Ossie explicitly supports multi-dialect expressions within a single model. The expression object contains a dialects array where you can define platform-specific variants for the same field or metric. As implemented in the Apache Ossie source code, converters select the appropriate dialect for their target platform while ignoring irrelevant entries, allowing one model file to serve Snowflake, BigQuery, and Databricks simultaneously.

How does Ossie handle unsupported dialects?

Ossie handles unsupported dialects through the ANSI_SQL fallback mechanism. If a converter encounters a model lacking its specific target dialect (for example, a Databricks converter finding no DATABRICKS entry), it searches for the ANSI_SQL expression instead. This ensures models remain functional even when deployed to platforms not explicitly targeted during model creation, as described in core-spec/expression_language.md lines 31-38.

Where are the SQL dialect enumerations defined in the Ossie codebase?

The SQL dialect enumerations are defined in core-spec/spec.yaml at lines 31-39. This file contains the canonical list of supported dialects including ANSI_SQL, SNOWFLAKE, MDX, TABLEAU, DATABRICKS, MAQL, and BIGQUERY. Additional documentation regarding these enumerations appears in core-spec/spec.md (lines 75-82) which details the schema structure, and docs/index.md (lines 62-66) which explains the practical usage of dialects in converter implementations.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →