Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core-spec/ossie-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"$defs": {
"Dialect": {
"type": "string",
"enum": ["ANSI_SQL", "SNOWFLAKE", "MDX", "TABLEAU", "DATABRICKS", "MAQL", "BIGQUERY"],
"enum": ["ANSI_SQL", "SNOWFLAKE", "MDX", "TABLEAU", "DATABRICKS", "MAQL", "BIGQUERY", "THOUGHTSPOT"],

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.

That's ok, but worth to note that some converters will "fail".

For instance in nvidia GSF, _pick_expression finds no ANSI_SQL and silently fails through to return expression[0]["expression"], writing the ThoughtSpot formula into a GSF model as a SQL expression (no warning).
I believe DBT and Honeydew converters will behave the same.

Before this PR, the schema gate rejected such a document. Now it is accepted and produces broken output two layers down. The root cause is that no converter has any machine-readable way to ask "is this dialect SQL?".

Nothing to consider soon.

"description": "Supported SQL and expression language dialects"
},
"Vendor": {
Expand Down
1 change: 1 addition & 0 deletions core-spec/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Supported SQL and expression language dialects for metrics and field definitions
| `DATABRICKS` | Databricks SQL |
| `MAQL` | GoodData MAQL (Metric Analysis and Query Language) |
| `BIGQUERY` | Google BigQuery (GoogleSQL) |
| `THOUGHTSPOT` | ThoughtSpot formula language |

### Data types

Expand Down
1 change: 1 addition & 0 deletions core-spec/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dialects:
- "DATABRICKS" # Databricks SQL
- "MAQL" # GoodData MAQL (Multi-Dimensional Analytical Query Language)
- "BIGQUERY" # Google BigQuery GoogleSQL
- "THOUGHTSPOT" # ThoughtSpot formula language (not SQL)

# Supported logical data types for fields and metrics
# TODO: Generate this list from the authoritative DataType enum in
Expand Down
1 change: 1 addition & 0 deletions python/src/ossie/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class OssieDialect(str, Enum):
TABLEAU = "TABLEAU"
DATABRICKS = "DATABRICKS"
BIGQUERY = "BIGQUERY"
THOUGHTSPOT = "THOUGHTSPOT"


class OssieDataType(str, Enum):
Expand Down
3 changes: 2 additions & 1 deletion validation/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@
"MDX": None, # Not supported by sqlglot, skip validation
"TABLEAU": None, # Not supported by sqlglot, skip validation
"MAQL": None, # Not supported by sqlglot, skip validation
"THOUGHTSPOT": None, # Not supported by sqlglot, skip validation
}

# Dialects that sqlglot cannot parse
SKIP_SQL_VALIDATION = {"MDX", "TABLEAU", "MAQL"}
SKIP_SQL_VALIDATION = {"MDX", "TABLEAU", "MAQL", "THOUGHTSPOT"}


def validate_schema(data: dict, schema: dict) -> list[str]:
Expand Down