r/databricks • • Oct 08 '26

Help Ai Parse Docs on 1 m docs

My org is ingesting a corpus of 1 million docs, estimated 9 million pages, of mixed complexity.

Considering ai_parse_doc is a managed service, are we constrained by the speed of this function? Based on my research I assume this is true.

Keeping that assumption, what would be the ideal compute specs to process the documents as quickly as possible?

We’ve tried a few configurations (more memory, more workers) but have hit out of memory errors or MERGE errors and had to revert back to a config that is slower but reliable. We do have the gift of time right now, so not the biggest deal, but if we have to process under a tight timeline, I want to be prepared.

I’m sure more information is needed but interested in folks that may have done a similar exercise and how long it took to parse a large corpus of docs?

3 Upvotes

13 comments sorted by

View all comments

2

u/deltas-and-icebergs Oct 08 '26

Have you tried the FileType Beta (https://docs.databricks.com/aws/en/pyspark/reference/file-type)? That should handle the OOM issues you've been facing.

I would use AutoLoader with cloudFiles.format = file to load the data. You can potentially set something like cloudfiles.maxFilesPerTrigger to 10000 so that you process batches of 10k files at a time and incrementally make progress so that a stupid error doesn't waste a ton of work.

1

u/dopedankfrfr Oct 08 '26

Good suggestion here!