Skip to content

feat(demo): privy - Fabric Livy without the throttling (POC, do NOT merge) - #262

Draft
Raki (mdrakiburrahman) wants to merge 7 commits into
mainfrom
dev/mdrrahman/privy
Draft

feat(demo): privy - Fabric Livy without the throttling (POC, do NOT merge)#262
Raki (mdrakiburrahman) wants to merge 7 commits into
mainfrom
dev/mdrrahman/privy

Conversation

@mdrakiburrahman

@mdrakiburrahman Raki (mdrakiburrahman) commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

What

Adds an experimental method: privy connection type as an alternative to
the Livy REST client this adapter normally ships with. Instead of talking to
the Livy statements API, it sends spark.sql(...) over an Azure Relay
Hybrid Connection
right into a Spark session that's primed up and ready to rip.

Why

No throttling.

How it works

flowchart LR
    dbt["dbt-core"] --> adapter
    cache[("job cache\n(local file)")] <--> adapter

    subgraph client["Developer / CI machine"]
        dbt
        adapter["dbt-fabricspark\n(method: privy)"]
        cache
    end

    adapter -- "trigger/poll" --> api["Fabric Job API"]
    api -.starts.-> notebook
    adapter == "spark.sql" ==> relay
    relay((Azure Relay)) <==> notebook

    subgraph fabric["Microsoft Fabric"]
        api
        notebook["Notebook\nRelayServer + Spark"]
    end
Loading

Do not merge - this PR was done to prove a point.

Raki (mdrakiburrahman) and others added 5 commits August 2, 2026 04:07
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ported from .temp/privy/scripts/upload_whl.sh, pointed at this repo's
built wheel instead of privy's. Uploads dist/dbt_fabricspark-*.whl to
the same rakirahman/public container, under whls/<wheel-name>.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mdrakiburrahman
Raki (mdrakiburrahman) marked this pull request as draft August 2, 2026 19:06
@mdrakiburrahman Raki (mdrakiburrahman) changed the title feat(spike): privy — Azure Relay connection method (POC, do not merge) feat(spike): privy - Fabric Livy, but faster (POC, do NOT merge) Aug 2, 2026
@mdrakiburrahman Raki (mdrakiburrahman) changed the title feat(spike): privy - Fabric Livy, but faster (POC, do NOT merge) feat(demo): privy - Fabric Livy, but faster (POC, do NOT merge) Aug 2, 2026
@mdrakiburrahman Raki (mdrakiburrahman) changed the title feat(demo): privy - Fabric Livy, but faster (POC, do NOT merge) feat(demo): privy - Fabric Livy without the throttling (POC, do NOT merge) Aug 2, 2026
Raki (mdrakiburrahman) and others added 2 commits August 2, 2026 19:48
Privy no longer serializes inprocess calls behind a global lock; stdout is
captured per thread and calls are dispatched on a thread pool, so concurrent
dbt threads execute in parallel.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ensure_database_exists issued a 'select 1' through Spark for every model on
non-schema lakehouses, costing a full relay round-trip per node. It is now a
Jinja no-op when there is no database to create.

The privy exec snippet now sets a Spark job group from the dbt node_id so
jobs are attributable and cancellable instead of inheriting the notebook's
start-up cell description, and skips collect() for statements that expose no
output schema.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mdrakiburrahman

Raki (mdrakiburrahman) commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator Author

I'm using this branch here with Ilaria Battiston (@ila):

mdrakiburrahman/openivm-spark#35
ila/openivm#10
cwida/lpts#18

So going to keep the PR open

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