Where the Spark Lab Stores Your Data, and How to See It in Docker
When you use the Spark Lab, your data never goes to Data Utility and never sits in the website. It lives on your own computer, inside Docker. This guide explains exactly where each kind of file is kept, how to look at it, how to copy it out, and how to clean it up. The commands work on Mac, Windows and Linux.
The short version
Everything the lab touches is stored inside the lab container, under one folder: /data. That folder is saved in a Docker volume called datautility-spark-data, so it survives when you stop and restart the lab. The only thing the website keeps in your browser is the list of Recent files, and only if you choose to save a result there.
The folders inside /data
- **/data/uploads**: files you upload from the page, or drop into the folder (see below). Spark reads them from here.
- **/data/outputs**: everything Spark writes. A single file from export(), or a folder of part files from df.write.
- **/data/spark-tmp**: temporary files Spark spills to disk while a big job runs. You can ignore it.
- **/data/orders.csv and /data/customers.csv**: the sample tables the lessons use.
What the browser keeps
Nothing, apart from Recent files. When you upload a file, it goes from your disk straight into /data/uploads. The page does not hold a copy. Recent files are the one exception: they are kept in your browser, up to 100,000 rows each, so you can reuse a file you converted or cleaned in another Data Utility tool. Big data stays in Docker.
See your files on the page
On the code page, click **Files in Docker** in the top bar. It lists everything in /data/outputs with its size. **View** shows the first rows as a table, **Save to recent** keeps a single file in Recent files with its lineage, and **Copy command** copies the docker cp command for that file. For a Spark folder, View shows the first part file.
See your files from a terminal
The Start command names the container spark-lab, so these commands work as they are:
- List the written files: docker exec spark-lab ls -lh /data/outputs
- List the uploads: docker exec spark-lab ls -lh /data/uploads
- Show the first lines of a CSV: docker exec spark-lab head -n 10 /data/outputs/your_file.csv
- Copy a file or folder to your computer: docker cp spark-lab:/data/outputs/north_orders ./north_orders
The commands run inside the lab, which is Linux on every system, so they are the same in PowerShell, Command Prompt and Terminal. In Git Bash on Windows, paths starting with a slash can be rewritten, so use PowerShell there.
See your files in Docker Desktop
Open Docker Desktop. Under **Containers**, open spark-lab and look for the **Files** tab to browse /data while the lab runs. Under **Volumes**, open datautility-spark-data to see the saved data even when the lab is stopped. Docker Desktop on a Mac or Windows keeps its disk inside a virtual machine, so you will not find these files in Finder or Explorer. Use docker cp or Docker Desktop to get them out.
Get files out after you stopped the lab
The volume keeps your data after the lab stops. Copy it out with a temporary container. On Mac or Linux: docker run --rm -v datautility-spark-data:/data -v "$PWD":/out alpine cp -r /data/outputs /out/spark-outputs. In Windows PowerShell use ${PWD} in place of "$PWD", and in Command Prompt use %cd%.
Use a folder on your computer instead
If you start the lab with the folder command, /data points to a normal folder on your disk: spark-lab in your home folder on Mac and Linux, or C:\spark-lab on Windows. Then uploads and outputs are ordinary files you can open in Finder or Explorer: put big files in spark-lab/uploads, and find results in spark-lab/outputs. This is the best choice for files of several GB, because nothing goes through the browser.
How much space it uses
Check what Docker is using with docker system df -v. Look for the volume named datautility-spark-data. Spark can use a lot of temporary space for big shuffles, so keep free disk of at least three times the size of your biggest file.
Clean up
To delete everything the lab stored, stop the lab first, then run docker volume rm datautility-spark-data. This cannot be undone. To remove only some files, use docker exec spark-lab rm -r /data/outputs/north_orders while the lab runs. If you used the folder option, delete files from the spark-lab folder as usual.
Privacy
The page sends your code to the lab on your own computer, and the lab only answers datautility.in with the token from your terminal. Your files, results and code are never sent to Data Utility.
Also try
How to use the Spark Lab: step by step
- Open Files in Docker on the code page
- Use View, or copy a command for a terminal
- Copy the files to your computer with docker cp
- Stop the lab and remove the volume when you are done
When to use the Spark Lab
- Finding where PySpark wrote your output
- Copying results out of Docker
- Freeing disk space used by the lab
- Explaining to a team where their data is kept
Frequently asked questions
Where does the Spark Lab store my data?
Inside the lab container under /data, saved in the Docker volume datautility-spark-data on your own computer. Uploads are in /data/uploads and results in /data/outputs.
Is anything stored in the browser?
Only Recent files, if you choose to save a result there (up to 100,000 rows each). Uploads and outputs stay in Docker.
How do I delete everything?
Stop the lab, then run docker volume rm datautility-spark-data. This cannot be undone.
Tip: If a command says there is no such container, the lab was started without the name spark-lab. Run docker ps, find the lab in the list, and use its name instead.