A scenario for a forward deployed engineer · Junior and up
Two million invoices by Friday
Penny · Finance
Tuesday, 08:50
A customer has two million invoice texts in a Delta table on Databricks and wants supplier, amount and due date pulled from each. A colleague's notebook loops over the rows and calls a chat endpoint one at a time.
What do you do?
Tap the one you would do. The answer opens below.
Show the best callThe best call
Run ai_extract over the whole table in one SQL query, from a job.
Databricks runs the calls in parallel and retries the ones that fail. The table is done well before Friday.
Why
AI Functions apply a model to data from SQL. ai_extract pulls structured fields from text or documents by a schema you define, and ai_query calls a model you choose. Run over a full table in one query they manage parallel calls, retries and scaling themselves, so Databricks advises submitting the whole dataset and not splitting it by hand.
Read it in the Databricks docs (opens in a new tab)The other two
- Works, at a price. Keep the loop, add threads and retries, and leave it running.
- It finishes in days, after you tune the number of threads around the rate limits twice.
- A poor call. Run the same loop on a bigger cluster.
- The cluster waits on the endpoint, one request at a time, at a higher price.
Go deeper on brickster.ai
- AI Functions: what changed recentlyNews, releases, videos and questions on it, gathered daily.
- Follow Unity AI GatewayNews, releases, videos and questions on it, gathered daily.
More scenarios
- One script starves everyone · forward deployed engineer
- The app shows everyone everything · forward deployed engineer
- You leave in two weeks · forward deployed engineer
- All 77 scenarios
Had one like this at work? Send it to us: the best tickets come from real incidents.
Added on . Checked against the Databricks documentation on . brickster.ai is independent and is not affiliated with Databricks.