yesterday
Hi everyone,
I build reports in Databricks from Excel files maintained by many different business users. The files are varied and come from different teams, and I havenโt settled on an approach yet.
One idea Iโm considering: create a landing location where users drop their Excel files, with the file owner providing the expected schema beforehand (columns, data types, etc.), so files can be checked before being loaded into Delta tables.
Iโd like to know how others handle this:
Weโre on AWS.
Thanks in advance for your feedback!
yesterday
We handled a similar use case where multiple business teams submitted files with varying structures and frequent template changes. The approach was to separate file collection, schema validation, and Databricks ingestion to make the process more reliable, governed, and easier to maintain.
1. How to collect Excel files:
My preference would be SharePoint/OneDrive for business-user submissions, with a controlled ingestion process landing original files in ADLS/S3 or UC Volumes.
I'd avoid using network shares or manual notebook uploads as the primary production interface unless there are specific constraints.
2. How to define and maintain schemas:
I'd ask each business team to provide an approved Excel template with expected sheet names, headers, data types, mandatory fields and sample records.
Maintain a versioned schema contract per source, ideally in a Delta configuration table or Git-managed YAML/JSON, with a designated business owner.
When the template changes, validate the proposed version, assess downstream impact and approve it before updating the ingestion configuration. Don't silently accept every new column or layout.
3. How to handle files that don't match:
I'd validate the workbook before promoting its data to curated tables.
This makes failures visible rather than silently dropping records or breaking downstream pipelines.
4. Pitfalls and lessons learned
Additional Spark 4.3 option: For ZIP deliveries containing CSV, JSON or XML, the opt-in native archive reader can process matching entries using archivePathFilter, avoiding explicit extraction in application code. ZIP packages containing Excel workbooks still require a separate handling approach.
Overall recommendation: Start with SharePoint/OneDrive โ governed landing โ schema validation โ Bronze Delta โ curated tables, supported by a schema registry, quarantine workflow and reprocessing capability.
Hope this helps and gives some more insights.
yesterday
We went a different route than the landing folder idea and it ended up solving
most of what you are describing, so it might be worth considering.
Instead of giving users a location to drop files into, we built a Databricks
App as the front door. The UI walks the user through the upload, and behind it
a job runs the ingestion scripts, landing the file in a volume and then moving
it into bronze.
The part that made the biggest difference was inverting your second question.
You are asking how to collect the expected schema from the file owner and keep
it current as the file changes. We stopped collecting it. The app lets the user
download either the existing table or a template, so they start from the shape
the platform already expects instead of describing it to us. The schema flows
from the platform to the user rather than the other way around, which also
means there is nothing to keep in sync.
Validation runs at upload time, inside the app. If the file does not match, the
user sees it right there and fixes it themselves. That is the real difference
versus a drop folder: with a volume plus a scheduled job, a bad file fails
hours later and someone from the data team has to go explain it to the person
who uploaded it. Here the feedback loop is seconds long, and the person looking
at the error is the one who can fix the file.
We also went with upserts rather than append only. Business users resubmit
corrected versions of the same file constantly, and if your load is append only
you end up building dedup logic for it anyway.
Fair trade-off though: this is more upfront work than a volume plus Auto
Loader. If you have a handful of files from technical users who will tolerate a
failure notification, the simpler path is fine. It pays off when you have many
files from many non-technical teams, which sounds like your case.
I am writing this up as a blog post at the moment, happy to share it here when
it is done if that is useful.
11 hours ago
@juanlozadab Thank you for your answer but it will be difficult to build an App for me. And our user will probably never go there
yesterday
We handled a similar use case where multiple business teams submitted files with varying structures and frequent template changes. The approach was to separate file collection, schema validation, and Databricks ingestion to make the process more reliable, governed, and easier to maintain.
1. How to collect Excel files:
My preference would be SharePoint/OneDrive for business-user submissions, with a controlled ingestion process landing original files in ADLS/S3 or UC Volumes.
I'd avoid using network shares or manual notebook uploads as the primary production interface unless there are specific constraints.
2. How to define and maintain schemas:
I'd ask each business team to provide an approved Excel template with expected sheet names, headers, data types, mandatory fields and sample records.
Maintain a versioned schema contract per source, ideally in a Delta configuration table or Git-managed YAML/JSON, with a designated business owner.
When the template changes, validate the proposed version, assess downstream impact and approve it before updating the ingestion configuration. Don't silently accept every new column or layout.
3. How to handle files that don't match:
I'd validate the workbook before promoting its data to curated tables.
This makes failures visible rather than silently dropping records or breaking downstream pipelines.
4. Pitfalls and lessons learned
Additional Spark 4.3 option: For ZIP deliveries containing CSV, JSON or XML, the opt-in native archive reader can process matching entries using archivePathFilter, avoiding explicit extraction in application code. ZIP packages containing Excel workbooks still require a separate handling approach.
Overall recommendation: Start with SharePoint/OneDrive โ governed landing โ schema validation โ Bronze Delta โ curated tables, supported by a schema registry, quarantine workflow and reprocessing capability.
Hope this helps and gives some more insights.
11 hours ago
@data_pulse Thank you i will give a try ! I like the approach
13 hours ago
You can use a Unity Catalog Volume backed by S3 as the landing zone and its the right way. You can give each source team their own folder in the volume, allowing users to drop files through the UI. Pipeline can pick up files on arrival using a job file arrival trigger, validate them and load them into Delta. More details here
If business users are already using SharePoint. Managed SharePoint connector is better if they already collaborate in SharePoint because it ingests Excel directly into Delta tables and keeps them in sync. More details here
Alternatively, you can create a Databricks App using Streamlit as a file upload portal. Users can upload the files to the app, which writes to a volume and can validate the file instantly to return messages like "column Amount is missing please fix and re upload." and more.
You can begin with an immutable raw landing copy of every file, organized with one folder per source team and append metadata columns (_file_name, _ingested_at) to every loaded row. For the schema contract, ask each owner once for a template file with headers and sample rows. You can derive and store the expected schema in a config table keyed by source name and when a file changes, ask the owner to request a schema version update that you can approve. Enforce a validation gate to check expected columns, parseability and null counts. Files that pass get merged into the published Delta table, while files that fail are moved to a failed directory with the failure reason and send an alert to the owner. For parsing, you can read the spreadsheets natively using spark.read or read_files with the format set to excel.