Skip to content

feat(showcase-ecommerce-mysql): add standalone MySQL datapack - #238

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

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

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 MySQL as the warehouse platform.

datapacks/showcase-ecommerce-mysql/

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. MySQL is two-tier (no catalog level), so unlike the other packs the dataset names change:

Dimension MySQL
Platform URN dataPlatform:mysql
Dataset names order_entry_db.<schema>.<table> → <schema>.<table>: each schema is a MySQL database, as the MySQL source names them (order_entry.orders, analytics.order_details)
Containers two top-level Database containers (order_entry, analytics), GUIDs from DataHub's DatabaseKey. No catalog container, and no default (Databricks' empty auto-created schema; default is a reserved word in MySQL)
Column types string→varchar(255), timestamp→datetime; int, bigint, double, date unchanged
Databricks-only metadata removed: Unity externalUrl, storage_location, table_id, table_type, delta.*, spark.*, view.* properties
SQL dialect 2-part table names; DATEADD → DATE_ADD(x, INTERVAL n UNIT); DATEDIFF(day, a, b) → DATEDIFF(b, a) (other units TIMESTAMPDIFF); DATE_TRUNC → DATE_FORMAT/MAKEDATE equivalents; CAST(… AS TIMESTAMP) → DATETIME; a || ' ' || b → CONCAT (|| is OR in MySQL); ARRAY_JOIN(COLLECT_SET) → GROUP_CONCAT(DISTINCT … SEPARATOR …); DESC NULLS LAST → DESC; QUALIFY → subquery; aliases on derived tables; reserved CTE names (lead, before) backticked; --, comments spaced (MySQL needs whitespace after --)
MEDIAN / PERCENTILE_CONT MySQL has neither. The 12 affected queries are hand-written with the usual MySQL 8 idiom: ROW_NUMBER() / COUNT() windows in a CTE, the median as the average of the middle row(s), and percentile p as the first row at rank ≥ CEIL(p * n) (nearest-rank). Each says so in a one-line comment.

Rewrites are textual, so author comments and layout are preserved.

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

  • The snowflake_freshness_check query family is now mysql_freshness_check.
  • View-lineage query URNs URL-encoded a Snowflake view; they now encode the MySQL 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 MySQL. Table names in prose and in the SQL examples use 2-part MySQL names.

Validation

  • SQL: every query statement, the view definition and the documents' SQL blocks were EXPLAINed on a live MySQL 8.4, 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). The percentile idiom was also checked numerically (values 1–10 with a NULL: median 5.5, p90 9).
  • Ingestion: loaded with datahub datapack load --url file://…/index.json into a local DataHub: zero failures. Read-back shows 14 datasets, 2 containers and 312 queries on mysql.
  • Structure: no Databricks, Unity, Delta or Spark leftovers; every MySQL 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'. 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 MySQL as the
warehouse. MySQL is two-tier, so each schema becomes a database and
datasets are named <database>.<table>. MySQL column types, Unity/Delta/
Spark-only properties removed, and all 312 queries rewritten to MySQL 8
SQL (validated with EXPLAIN on a live MySQL 8.4), including window-function
rewrites for MEDIAN and PERCENTILE_CONT.

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