fix: large spreadsheet upload takes minutes and stalls the server (#33770)

Uploading a big, sparsely filled .xlsx sent the document parser into a very slow table-detection step; a 28,000-row sheet took around 13 minutes, long enough for health checks to fail and pods to be restarted. Spreadsheets are now read as a whole sheet without that step, which took a 2,500-row sheet from 17.6 s to about 1 s with identical text. Sheets that hold several separate tables on one sheet now come out as one block instead of one block per table.

Fixes #33768
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-05 21:47:16 +09:00
1 parent bc14c37670
commit e9cb194f46
1 file changed
+2 -1
+2 -1
View File
@@ -785,7 +785,8 @@ class Loader:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
] or file_ext in ['xls', 'xlsx']:
try:
loader = UnstructuredLoader(file_path, 'xlsx')
# Subtable detection is very slow on large sparse sheets.
loader = UnstructuredLoader(file_path, 'xlsx', find_subtable=False)
except ImportError:
log.warning(
"The 'unstructured' package is not installed. "