SODA: read document content larger than 32767 bytes (#211)#216
Merged
Conversation
A document's content used to be read through a single DBMS_LOB.SUBSTR, so a value over the 32767-byte PL/SQL window raised NotSupportedError rather than truncating. Read it whole instead: getDocuments still returns the inline 32767-byte window per document in the batch, and any document whose reported length exceeds that is backfilled by slicing its BLOB into 32767-byte chunks (a RAW host array, one round trip per oversized document, re-opened by key). Small documents keep their single-round-trip inline read. getOne / getDocuments / getCursor share the build path, so all three now return large content whole. Verified byte-exact round trips past the window (incl. the 32767 / 32768 boundary), and that a batch with several large documents keeps each one's content distinct. The old inline-cap guard (and its dead helper) are removed. Sync + async; 23ai/21c pass, 11g/9i skip. Closes #211 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The last SODA follow-up: read document content past the 32767-byte inline window, which previously raised
NotSupportedError.How
getDocumentsstill returns the inline 32767-byte window per document in the batch read (one round trip, the common small-document case). Any document whose reported length exceeds the window is backfilled by slicing its BLOB into 32767-byte chunks — a RAW host array filled in one PL/SQL block, re-opened by key, one extra round trip per oversized document.getOne/getDocuments/getCursorshare the build path, so all three return large content whole.Tests
The old inline-cap guard and its now-dead helper are removed. Sync + async; 23ai/21c pass, 11g/9i skip. Offline 526.
Closes #211
🤖 Generated with Claude Code