Skip to content

Bundle JupyterLab with a sample notebook for the lakehouse over Spark SQL Connect #20987

Todo

Description

@nsivabalan

Task Description

Bundle JupyterLab with the packaged lakehouse as the notebook client for Spark SQL Connect, and ship a sample notebook.

Notebooks connect straight to Spark SQL Connect and do not go through the agent gateway. The gateway's agent path stays read-only. Users write to Hudi tables through clients such as JupyterLab, which makes it the main way users write data. This matches RFC-117's split: agents read, clients write.

Superset (#20467) stays the BI tool. It has no notebook interface, which is why a separate notebook is needed.

Scope

  • Image. A JupyterLab image built on quay.io/jupyter/minimal-notebook (BSD-3-Clause). It adds the Spark Connect Python client and nothing JVM-based:

    • pyspark-client (Apache-2.0, pure Python) if the lakehouse's Spark version is 4.x;
    • pyspark[connect] if it is 3.5.

    It is published with the other lakehouse images (Publish Docker images for the Docker Compose lakehouse install with each release (explore and propose) #20985).

  • Docker Compose (Add Docker Compose installation for the Hudi lakehouse #20620).

    • Add a notebook profile (lakehouse.sh up --profile notebook). Folding it into the existing bi profile is an alternative; decide during implementation.
    • Set SPARK_REMOTE=sc://spark-connect:15002, bind the port to 127.0.0.1, and keep notebooks in a named volume.
  • Helm / local Kubernetes. Add a matching chart value to enable JupyterLab next to Spark SQL Connect.

  • Sample notebook on the sample trips / drivers tables, covering:

    • reads: filters, aggregations, and a trips → drivers join;
    • a MERGE INTO upsert;
    • index DDL, for example CREATE INDEX (secondary or expression index) and a query that uses it;
    • an incremental query, plus time travel where useful.
  • Validation. Run the sample notebook headless in CI (for example with nbclient / papermill) against the Compose stack, next to the Spark SQL Connect quickstart validation (test(spark): add Spark Connect quickstart validation #20462).

  • Docs. How to open JupyterLab, how to connect from the notebook, and the note that notebook writes do not go through the gateway.

Out of scope

  • marimo as an additional notebook option (possible follow-up).
  • Authentication for JupyterLab beyond binding to localhost. That is covered by the later governance work.

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions