Skip to content

feat(showcase-ecommerce-trino): add standalone Trino datapack - #237

Open
askumar27 wants to merge 3 commits into
mainfrom
feat/showcase-ecommerce-add-trino
Open

askumar27 wants to merge 3 commits into
mainfrom
feat/showcase-ecommerce-add-trino

Conversation

@askumar27

@askumar27 askumar27 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds a standalone datapack that mirrors the Databricks showcase-ecommerce datapack with Trino as the warehouse platform.

datapacks/showcase-ecommerce-trino/

Self-contained (01-definitions → 05-context + index.json), stacked on #200 like #209. It can be loaded on its own or next to the other showcase packs.

How it was derived

Generated from showcase-ecommerce-databricks with a platform transform, as in #209:

Dimension Trino
Platform URN dataPlatform:trino
Dataset names unchanged: order_entry_db.<schema>.<table> (catalog.schema.table)
Containers Database (catalog) / Schema, GUIDs from DataHub's DatabaseKey / SchemaKey, so they match what the Trino source emits
Column types string→varchar, int→integer, timestamp→timestamp(3); bigint, double, date unchanged
Databricks-only metadata removed: Unity externalUrl, storage_location, table_id, table_type, delta.*, spark.*, view.* properties
SQL dialect DATEADD/DATEDIFF → date_add/date_diff('unit', …), MEDIAN/PERCENTILE_CONT … WITHIN GROUP → approx_percentile, ANY_VALUE → arbitrary, TO_DATE → CAST(… AS DATE), DATE_FORMAT patterns, ARRAY_JOIN(COLLECT_SET) → array_join(array_agg(DISTINCT)), date literals typed as TIMESTAMP '…', qualifiers dropped from JOIN … USING columns (Trino rejects o.order_id there), QUALIFY → subquery, column lists on recursive CTEs

Rewrites are textual, so author comments and layout are preserved. The USING-column fix is scope-aware (sqlglot scopes), so only qualifiers naming a relation in that USING join are dropped.

Also fixed in this pack (inherited from the Databricks pack):

  • The snowflake_freshness_check query family is now trino_freshness_check; its name, description and comment pointed at Snowflake.
  • View-lineage query URNs URL-encoded a Snowflake view; they now encode the Trino view.
  • Shared-layer containers (Looker, Tableau, Power BI, S3, Postgres) keep their own platform property. feat(showcase-ecommerce): add Redshift and BigQuery datapacks #209's transform set all 14 of them to redshift / bigquery.
  • Knowledge documents: Snowflake prose and related assets repointed to Trino, and their SQL examples rewritten to Trino.

Validation

  • SQL: every query statement, the view definition and the documents' SQL blocks were run through EXPLAIN (TYPE VALIDATE) on a live Trino, with tables built from the pack's own schemaMetadata. 311/312 queries valid. The one failure is q-noise-abandoned_logon_to_order_funnel, a deliberate noise query on a logon table that is in no pack (same in the Databricks pack). sqlglot type annotation found no integer/integer divisions, where Trino and Databricks would give different results.
  • Ingestion: loaded with datahub datapack load --url file://…/index.json into a local DataHub: zero failures. Read-back shows 14 datasets, 4 containers and 312 queries on trino.
  • Structure: no Databricks, Unity, Delta or Spark leftovers; every Trino dataset and container URN referenced in the pack exists in it (only the noise query's logon table is missing).

Notes

  • The knowledge documents (urn:li:document:ecomm-*) and the shared layer (dbt, Looker, Power BI, Tableau, S3, Postgres) have the same URNs in every showcase pack, as in feat(showcase-ecommerce): add Redshift and BigQuery datapacks #209. If two platform packs are loaded into one instance, the last one loaded owns them.
  • The documents' SQL examples inherit one issue from the source pack: they filter the integer order_status column with 'Cancelled' / 'On Hold'. Trino rejects that comparison; it is left as in the other packs.

🤖 Generated with Claude Code

askumar27 added 3 commits June 2, 2026 17:11
Add a new `showcase-ecommerce-databricks` datapack that mirrors the existing
Snowflake showcase-ecommerce datapack with Databricks as the warehouse platform.

- 14 Databricks datasets (order_entry_db.order_entry + analytics schemas)
- Full governance parity: tags, glossary terms, ownership, domains, structured
  properties, editable descriptions, lineage, siblings, schema fields
- 312 queries translated from Snowflake SQL to Databricks SQL dialect
  (CAST syntax, DATEADD/DATEDIFF units, LISTAGG -> ARRAY_JOIN, TO_CHAR -> DATE_FORMAT)
- All cross-platform entities included (dbt, Looker, PowerBI, Tableau, Spark, etc.)
  with Snowflake order_entry_db references remapped to Databricks
- Can be loaded independently or alongside the Snowflake datapack (no URN conflicts)
…r ingestion

Add queryUsageFeatures aspect to all 312 query entities so semantic-anchor
ingestion can discover and group them. Without this aspect, queries default
to exec_count=0/users=[] and get filtered by the min_distinct_users threshold.

- Cluster queries (160, 50 intents): exec_count 15-45, 3-4 users each
  Users derived from SQL author comments + intent-group sharing
- Noise queries (152): exec_count 1-5, 1-2 users (correctly below threshold)
- Uses the 8 author personas from Alex's query corpus README
Mirror of the Databricks showcase-ecommerce datapack with Trino as the
warehouse: Trino platform URNs, Database/Schema containers keyed like the
Trino source, Trino column types, Unity/Delta/Spark-only properties
removed, and all 312 queries rewritten to Trino SQL (validated with
EXPLAIN on a live Trino).

This branch has not been deployed

No deployments
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.

1 participant