Skip to content

Add BI SQL examples capturing tool-generated metric queries - #344

Open
christianeu-db wants to merge 2 commits into
apache:mainfrom
christianeu-db:add-bi-sql-examples
Open

Add BI SQL examples capturing tool-generated metric queries#344
christianeu-db wants to merge 2 commits into
apache:mainfrom
christianeu-db:add-bi-sql-examples

Conversation

@christianeu-db

Copy link
Copy Markdown
Contributor

One action item from the most recent (2026-08-26) language working group was to collect and commit examples of BI-generated SQL. BI tools have built rich functionality (for example, multi-table modeling, LOD calculations, subtotals), which can involve complex SQL. The SQL generated for similar features can be different across tools, and even within a single tool. This is especially true when you consider the optimizations applied by tool-specific query compilation pipelines.

This PR adds a first set of SQL examples as generated by Tableau. The features include top-N filters, sets, LOD (level of detail) calculations and multi-table analysis. These are adopted from this document, which fleshed out a SQL interface the working group is now calling the metric layer interface.

Separate PRs will describe the layered interface approach and the semantics of each layer, as discussed at the working group meeting.

Add bi-sql-examples/ with real SQL that BI tools generate when they query
metrics defined outside the tool. Include a tableau/ subfolder with a
setup.sql model sketch, a README, and four feature-area examples: top-N
filters, LOD two-stage aggregation, sets, and multi-table joins and
relationships. These query shapes help verify that Ossie can cover the
complex cases BI tools produce.
@jbonofre
jbonofre self-requested a review August 28, 2026 12:37

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

Please add the ASF header in all files.

@@ -0,0 +1,101 @@
-- ============================================================================

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.

ASF header is missing here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the feedback - the headers have been added to this and all other files

Add the Apache Software Foundation license header to all files introduced
in this PR: the HTML-comment style for Markdown files and the SQL
line-comment style for .sql files.

Co-authored-by: Isaac <no-reply@databricks.com>

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants