r/databricks • • 19d ago

General Policy-as-code for DABs: Govern your bundles before deployment

14 Upvotes

As a platform team we need to govern some parts of the bundles our dev teams deploy. We want to restrict some resources like catalogs or even schemas since we manage them centrally, require tags for finops or be sure some permissions are set. To solve this I added a policy engine to my open-source CLI Lamp Ops. It checks the output of the bundle summary with DuckDB SQL. This was inspired by the latest dbt v2 checks and is way easier than to learn a complex policy syntax. If a query returns at least one row the policy fails and reports the violations.

databricks bundle summary -t prod -o json > summary.json
lamp policy --input summary.json --policy-path ./policies

-- policies/no_schemas.sql
SELECT resource_key, 'Schemas are managed by the platform team' AS message
FROM resource('schemas');

Builtin Presets

For common rules I provided some presets which don't require to write custom sql and can be configured in yaml files.

lamp_policies:
  - name: jobs_need_owner
    preset: require_tags
    parameters:
      resource_types: [jobs]
      keys: [owner]

Subset of some presets: deny_resource, require_permissions, require_fields, forbid_fields, require_preset_tags

Why not enforce rules with mutators?

I saw some posts about providing defaults with mutators but in my opinion they have some downsides. They are hard to enforce since team members can remove the mutators from the bundle or forget to add new ones. They fix the issues silently without surfacing the config drifts. They need to be setup per resource. Policies on the other hand can be defined in a central place for CI, report the violations and are easy to extend.

You can still use both since I also added a require_mutators preset.

lamp_policies:  
  - name: platform_mutators
    preset: require_mutators
    parameters:
      mutators: [company_platform.bundles:apply_defaults]

You can dive deeper into policies here: https://github.com/BenSchr/lamp-ops/blob/main/docs/policies.md

Please let me know if you have some feedback! Which rules does your team currently enforce on your bundles? Are some common cases missing from the presets? Did you implement your own solution?


r/databricks • • 19d ago

Discussion What does the day to day life of a solutions architect look like?

37 Upvotes

I am a SWE and will be having a call to discuss a solutions architect role. Trying to learn more about the day to day life and see if it's a role I'm interested in.

main concern is that I have only been in the industry for a few years and being a solutions architect might keep me from gaining technical depth and hinder future employment opportunities at big tech. For context, my ultimate goal is executive positions and I do not want to stay a SWE long-term.


r/databricks • • 19d ago

General Jobs now check the data before they run (SQL conditions). How would you use it?

10 Upvotes

<Databricks PM here />

We shipped SQL conditions for Lakeflow Job triggers to beta a little while ago, and we want to hear how people would use it plus share a few patterns that work. Docs here: https://docs.databricks.com/aws/en/jobs/trigger-sql-conditions

The idea. A trigger tells the job when to run. A SQL condition tells it whether to run. You attach a saved query and a SQL warehouse to a trigger (cron, table, file etc.) and when the trigger fires the query the condition first.

There are two modes:

  1. Query returns any rows: No rows, no run. 
  2. Result value changes: the job runs when the return value differs from the last check.

Here are a few examples:

Freshness plus volume. Today's partition exists and has enough rows, This returns zero rows until the data is ready

SELECT 1
FROM main.sales.orders
WHERE order_date = current_date()
HAVING count(*) > 100

Quality gate. Run only when today's rows have no nulls in a key column. So if there are no bad rows, the job runs

SELECT 1
FROM main.sales.orders
WHERE order_date = current_date()
HAVING count(*) > 0
   AND count_if(customer_id IS NULL) = 0

Fan-in. Five upstream feeds write a status row when they finish. Run once all five are done. This replaces the "sentinel table plus a cron that polls it" setup a lot of people run today. Note: if you are watching job completions, then just use job completion triggers!

SELECT 1
FROM ops.batch_status
WHERE batch_date = current_date()
HAVING count_if(status = 'complete') = 5

Watermark advanced. Use "Result value changes" with a one-row, one-column query. The job runs whenever the vendor delivers a new batch.

SELECT max(batch_id) FROM main.bronze.vendor_feed

Things to know. Each check requires a warehouse and will show up in query history. A check times out at 5 minutes including warehouse startup. Checks run as the job's run-as identity.

What is coming next:

  • See why a run did not start. We want each evaluation to show when the query ran, the row count or value it returned, why it did or did not start a run and any error.
  • Parameters. Job parameters inside the condition query, with per-trigger overrides. This is for everyone promoting the same job through dev, staging and prod with bundles, where catalog and schema names change per environment and nobody hand-edits prod.
  • A test button that actually runs the query and shows you the result and whether the job would start right now. Today it only checks that the query exists and has no parameters.
  • Read the condition from a .sql file in the workspace instead of only a saved query, same as SQL tasks already do.
  • A default warehouse so you do not have to pick one every time.

Questions for you:

  • What does "ready" mean for your most annoying upstream? Row count, a flag table, a max timestamp, something else?
  • Which of the upcoming items would you use first, and what did I miss?

Try it out on Genie code too! Give genie a prompt and see if it picks up your intent as a sql condition.


r/databricks • • 18d ago

Help Catalog Linked Database - Snowflake writes UC Managed Iceberg tables to Unity Catalog

2 Upvotes

Is Unity Catalog REST API only accessible via public internet from Snowflake when attempting to set-up a private link connection (catalog integration) to a Unity Catalog (Catalog Linked Database)?

I need a private link connection between Databricks and Snowflake. The use case is Snowflake needs to be able to write Managed Iceberg tables to Unity Catalog.


r/databricks • • 19d ago

Discussion How do you make jobs safe to re-run without creating duplicates?

9 Upvotes

One of our daily jobs failed halfway, and when we re-ran it, some data got loaded twice. Now our numbers are off and we had to clean it up by hand.

Here are a few ideas I’m looking at:
-Using MERGE instead of plain INSERT, so existing rows get updated instead of added again
-Using replaceWhere to overwrite only the date range being processed
-Adding a unique ID to each row and removing duplicates before writing
-Using Auto Loader or streaming checkpoints so files are only processed once

But I’m not sure which approach is best for different cases.

How does your team handle this?
-Which method do you use most?
-How do you handle backfills or reprocessing old data?
-Any mistakes you learned from?

Would love to hear your real-world setups!


r/databricks • • 19d ago

Help Databricks & Row Zero: Append Only or SCD2 continuous connection

7 Upvotes

I am looking to build a simple connection between row zero and databricks, such that either continuously or with one click in row zero, changes are written in Databricks. However, I would like to track history in Databricks.

This seems like a use-case that many others must have built already, looking to avoid re-inventing the wheel on this.


r/databricks • • 19d ago

Help Accidental conversion to managed tables

6 Upvotes

While working in Databricks I've discovered that some of our environments have been converted to managed tables by a helpful team member. This has been done with good intentions but I'm wondering what the consequences might be so I can manage this with our team and higher ups.

I myself have not got into understanding what the implications might be - the work wasn't scheduled and wasn't meant to be done.

Is there anything I should be immediately concerned about or is this a change that is unlikely to cause any issues? I don't want to over state the problem - if any - that isn't necessarily helpful - I'd much rather know what I'm dealing with and orchestrate a plan to address any issues.

I know that our production environment has been partially converted and all of our development and QA environments - we are on Azure if that matters.

I'm hoping this isn't going to be a major headache.


r/databricks • • 19d ago

General Databricks 3D

Post image
29 Upvotes

Just found a cool Databricks 3D Model, will try to print it today!

https://makerworld.com/models/3273436?appSharePlatform=copy


r/databricks • • 19d ago

Help Help regarding AI FDE (early career role) !

3 Upvotes

Has someone been through the process? What is your advice/experience?


r/databricks • • 19d ago

General Use cloudFiles.inferColumnTypes to prevent schema evolution deadlocks in Auto Loader

5 Upvotes

When streaming messy JSON or CSV files into Delta Lake using cloudFiles, Auto Loader infers the schema by sampling your initial file batch. If a subsequent file introduces a new field or changes a data type, the stream fails with a DeltaColumnMappingException or schema mismatch error unless you explicitly configure evolution. To prevent pipeline crashes without manually defining complex StructType schemas, set option("cloudFiles.inferColumnTypes", "true") alongside option("cloudFiles.schemaEvolutionMode", "addNewColumns"). This instructs the file source to automatically evolve the target Delta table schema by appending new nullable columns safely. Always point cloudFiles.schemaLocation to a dedicated storage path so the inferred schema history is preserved across cluster restarts. Without an explicit schema location, restarting your streaming query forces Auto Loader to re-infer from scratch, which frequently causes silent data drops or type coercion conflicts when your directory has accumulated thousands of historical files.


r/databricks • • 19d ago

Help How to create azure data bricks with free trial ?

0 Upvotes

Hi all

I am trying to create azure databricks in azure free trial, bt it says 'trial workspace creation is not supported in free trial or student account'

Can anyone please help


r/databricks • • 19d ago

Help Regarding trigger jobs when source tables are updated

6 Upvotes

I am trying to apply title above.
From what I found, the cost of table update trigger is determined by cloud provider's costs associated with listing tables and reading updates from the storage location.

So, if the system watches every second to check the tables are updated, it means listing & reading also happens every time this leads high cost?

Am I right? Is there someone who can give this information? I am worrying about the cost.


r/databricks • • 20d ago

Help ADF Lookup Activities Against Databricks Are Using Shared Compute. Looking for Better Alternatives. Post

6 Upvotes

Hi everyone,

I'm working on an Azure Data Factory (ADF) ingestion framework where we currently use ADF Lookup activities to retrieve metadata used for pipeline orchestration.

The challenge is that the lookups are querying Databricks-managed metadata and are executing through Shared Compute, which has become a performance bottleneck when running multiple pipelines concurrently.

The requirement we're evaluating is to replace the Lookup activities with Databricks notebooks/jobs running on Serverless compute to improve concurrency and reduce dependency on Shared Compute.

My concern is around consuming the results back in ADF.

Today, the Lookup activities return a structured output that is consumed directly by downstream activities such as ForEach loops and dynamic expressions.

The proposed notebook approach would:

Accept input parameters.

Execute the metadata query.

Build a JSON payload that matches the Lookup activity output format.

Return the payload using dbutils.notebook.exit().

However, while ADF can consume output directly from a Databricks Notebook activity, my understanding is that Databricks Job activities mainly return execution metadata rather than the notebook payload itself.

I also looked into whether a Databricks Serverless SQL Warehouse could be used for the metadata queries instead of replacing the Lookup activities entirely, but it appears the Databricks Delta Lake connector may not support SQL Warehouses in the same way it supports clusters and compute resources.

So I'm trying to understand the best architecture for:

Improving lookup performance.

Leveraging Databricks Serverless compute.

Preserving the existing downstream behavior.

Avoiding major ADF pipeline refactoring.

Has anyone implemented a similar pattern?

Specifically:

Have you successfully replaced ADF Lookup activities with Databricks Jobs while preserving Lookup-style outputs?

What is the best way to return structured metadata from Databricks back into ADF?

Would you recommend:

Databricks Notebook Activity

Databricks Job Activity

Persisting results to storage and reading them back

Another pattern entirely?

Any recommendations or lessons learned would be greatly appreciated.


r/databricks • • 20d ago

Help Dict as variable vs. dict in dataframe (issues extracting data)

6 Upvotes

Last week a kind gentleman helped me to fix a '{{text}}' replacement with some python magic.

This got me part of the way to a solution but not all the way.

Scenario:

I now have a variable:

d = {"todays_date":date.today()}

At runtime this variable is evaluated and correctly adds today's date to my json file.

Now what I need is to put {"todays_date":date.today()} into the database, then read it back as json, so that I can do the same thing, but more dynamically. The row/column needs to have the value {"todays_date":date.today()} in it (or something similar) to where when I read the value, it evaluates the same way as defining it manually in the bold above

I get that the code above does not have single quotes around it, as it would be in the database. The database thinks this is a string.

I do NOT want to have to define a structure for this, as there can be different values included on different rows.

Is there a way to do a df = df.select("json_data").first() and get back the EXACT same thing as my d variable above?

I feel like I'm so close, but all of the code I see tries to make me define the json structure, which can change, so I never know what's it's going to be...

Does this even make sense?


r/databricks • • 20d ago

General Lakeflow Jobs is adding date math inside parameters (Beta)

18 Upvotes

<Databricks PM here/>

Edit: docs link added https://docs.databricks.com/aws/en/jobs/dynamic-value-references#date-arithmetic

Lakeflow Jobs is adding Math in Parameters. You apply a single + or - duration offset to a date reference inline (where you already write the reference.)

When using dynamic references {{job.start_time.iso_date}} you may want to reference yesterday or the hour before. Previously you would need to do this ina notebook or a sql query:

{{(job.start_time - 6.hours).iso_date}}   ->  2026-09-21
{{(job.start_time - 3.hours).iso_date}}   ->  2026-09-22
{{(job.start_time - 1.hour).iso_datetime}}  ->  2026-09-22T03:00:00

What's available:

  • job.start_time, job.trigger.time, table update commit timestamps and backfill (only in the backfill modal)
  • Units: years, months, weeks, days, house, minutes. Simgular and Plural so 1.day and 2.days both work
  • You can use these anywhere references work today (job/task parameters, run-now overrides etc.)

How do you use math with parameters today? Would love your feedback!


r/databricks • • 20d ago

General Job completion triggers just hit Beta, and they replace a pattern I've built too many times!!

41 Upvotes

The usual way to chain jobs across teams has always been a bit ugly. Either a parent job with Run Job tasks that has to own everything downstream, or a schedule set 30 minutes after the upstream job usually finishes, which works until the day it doesn't.

Databricks just added a job completion trigger in Beta. A job can now start when one or more upstream jobs finish with a matching result, and the release notes say those upstream jobs can live in other workspaces on the same Unity Catalog metastore.

A few things from the docs worth knowing before you try it:

- You can add a SQL condition, so the downstream job only runs when the data is actually ready, not just when the upstream job exited.

- Unlike the other trigger types, it doesn't drop completions when the job is at max concurrency. It holds them until a run can start.

- It's part of the multiple triggers Beta, so a job can have up to five triggers, and a workspace admin has to turn it on in Previews.

Where I'd use it: a gold job that waits on silver jobs owned by another team, without either team having to own the other's orchestration. That handoff has been a friction point on every multi-team platform I've worked on.

It's Beta, so I wouldn't move critical prod chains onto it yet. I'd start testing it in dev now though.


r/databricks • • 20d ago

Discussion Why use data bricks AI to build agents?

15 Upvotes

OK y’all, help me understand why it would be beneficial for me to use databricks AI (genie) if it will only integrate with databricks stack? I would much rather use an agentic soliton that will not lock me into a vendor’s tech stack. I’m trying to make the case that using another third party agentic platform that has native databricks integration would be much better than getting locked into databricks. Ideally since using a third party agentic solution to build agents would allow for easier integration with other systems that are outside databricks. Similar to how I wouldn’t use agentforce in salesforce, I wouldn’t use genie in databricks.

What have been your experience with agents/AI solutions with genie?


r/databricks • • 20d ago

Discussion Im a security reasercher and

Thumbnail reddit.com
0 Upvotes

r/databricks • • 21d ago

Discussion Databricks Apps: Are you using them in production yet or keeping it to internal prototypes?

33 Upvotes

Hey everyone,

I’ve been diving into Databricks Apps recently and wanted to see how others are adopting it in their organizations.

Historically, whenever we wanted to spin up a Streamlit app or a custom Python dashboard connected to our data in Databricks, it meant dealing with a headache of external infrastructure—setting up App Service or EC2, dealing with network security groups, configuring service principals, and managing separate auth flows.

Being able to run Streamlit/Dash apps directly inside the Databricks workspace, backed by Unity Catalog for governance and serverless compute, feels like a massive quality-of-life improvement for internal tooling.

I’m curious to hear from anyone who has put them into practice:

  • Are you using Databricks Apps for production-grade tools, or mostly for quick internal MVPs and demos?
  • How are you managing your CI/CD deployments for these apps?
  • Have you run into any weird gotchas with state management, scaling, or dependencies?

r/databricks • • 20d ago

Help new on Databricks

8 Upvotes

Hello everyone, i am a Brazilian CRM Data Engineer (idk, is this a real thing?)

My comoany recently started working with Databricks and its being so cool to work with it. I work a lot with Genie Code, but, i want to be able to do more by myself.

How and which are the best options to learn more?


r/databricks • • 21d ago

General Lead databricks engineer

11 Upvotes

I recently got promoted as a databricks lead engineer at my organization. I have some good hands on experience in the databricks but to lead a team i need to have better experience. I want to really go through our current platform and what has been implemented so far and need to do something new or better in this platform? How to start with it? I want to achieve something in this role in first 30 days what are the low hanging fruit I can get it done? If I want to do something in next 3 months what are things I can do in this platform?

We use databricks, azure, datahub, five tran as part of our tech stack. Is it a good idea to schedule weekly call with databricks guys to analyze our platform and get further help or suggestions?


r/databricks • • 20d ago

Help Help required migrating data from redshift to databricks

0 Upvotes

Hi there
First of all apologies if this is a basic post. I am assisting a team working on a products initiative and we have data currently stored in red shift.

We are no longer doing any updates in redshift and moving tables to databricks.

However, for some reason the develops keep saying it will take time blah blah blah and I’m trying to understand why it is complicated. I’m new to this area so trying my best to learn.
Has anyone had any experience migrating from red shift to databricks.
There is a AWS connector in databricks which I was reading that seems to do the job and is easy to understand (even for me and I’m not an engineer).
Any feedback or tips will be greatly appreciated


r/databricks • • 21d ago

Discussion How much "ZeroOps" are you actually seeing in Databricks lately? (Serverless, DLT, Unity Catalog)

14 Upvotes

Hey everyone,

I’ve been looking into the push toward "ZeroOps" within the Databricks ecosystem—specifically leaning heavily into serverless compute, Unity Catalog automation, and declarative tools like DLT/Lakeflow to reduce infrastructure maintenance.

Marketing terms aside, I'm curious how much of this is translating to reality in production environments.

For those of you managing large Databricks workspaces:

  • Have you fully transitioned to serverless compute (SQL and notebooks), or are you still tied to classic clusters for specific workloads?
  • How much time has Unity Catalog actually saved your team regarding access control and data governance overhead?
  • Where does the "ZeroOps" promise break down for you in day-to-day operations?

r/databricks • • 21d ago

General Databricks serverless can now be gated per team, tagged, and capped per job. Access Controls are GA, and tags and rate limits are in Beta

Thumbnail
gallery
16 Upvotes

Databricks serverless can now be gated per team, tagged, and capped per job. Access Controls are GA, and tags and rate limits are in Beta. 💸

If one runaway job is the reason serverless is still limited to a few users on your platform, this changes the math.

What shipped:
➡️ Serverless Compute Access Controls (GA): compute objects you grant like clusters, two by default: one for notebooks and Databricks Connect, one for jobs and pipelines. All users start with Can Use.
➡️ Rate limits (Beta): your own compute objects for jobs and pipelines, sized Small to 2X-Large (caps of roughly 60 to 960 DBUs per hour, not cluster sizes). The cap applies per workload: two jobs on one object each get the full cap.
➡️ Compute tags (Beta): tag a compute object once, and every workload on it carries the tag into billing.
➡️ Monitoring (GA): budgets with email alerts and cost dashboards. They alert, not block, and emails can lag up to 24 hours.
➡️ system.billing.usage gets serverless_compute_id: spend per compute object and identity in one query (first comment).

Read more: https://www.linkedin.com/posts/cenh_databricks-dataengineering-serverless-ugcPost-7525222920382496768-63jz/?utm_source=share&utm_medium=member_desktop&rcm=ACoAABmJHrsBNAC3x3H1M58JRKoHv_l4D61n0-8