RDBC-1037 RDBC-1038 Fix load_into_stream and implement stream_into/to_stream#278
Open
redknightlois wants to merge 1 commit intoravendb:v7.1from
Open
RDBC-1037 RDBC-1038 Fix load_into_stream and implement stream_into/to_stream#278redknightlois wants to merge 1 commit intoravendb:v7.1from
redknightlois wants to merge 1 commit intoravendb:v7.1from
Conversation
…ssion streaming APIs
- _load_internal_stream: write serialized result to output stream instead of reading from it; broaden exception handler from IOError to Exception and use proper raise-from chaining; filter None fields from to_json() output so the stream matches the server wire format (only fields the server actually sent)
- load_starting_with_into_stream: add required output parameter, validate it, fix grammar error in id_prefix guard message, delegate to internal helper; filter None fields at write site
- stream_into: implemented; writes {"Results":[...]} incrementally to output as JSONL items arrive — no full in-memory buffering; matches C# StreamInto format expected by JObject.Load / json.GetValue("Results") tests
- DocumentQuery.to_stream / RawDocumentQuery.to_stream: convenience wrappers over session.advanced.stream_into
Tests:
- dotnet migrated test (RDBC-1037): load_into_stream and load_starting_with_into_stream write valid JSON to BytesIO; every integration test asserts exact count and field values
- dotnet migrated test (RDBC-1038): stream_into and to_stream write Results JSON; each integration test asserts count and field values for every result; unit test verifies the method rejects non-query arguments at runtime
- JVM migrated test: adds test_can_load_by_ids_into_stream (port of C# CanLoadByIdsIntoStream) alongside the existing load_starting_with test
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.
Issue link
https://issues.hibernatingrhinos.com/issue/RDBC-1037
https://issues.hibernatingrhinos.com/issue/RDBC-1038
Additional description
RDBC-1037 –
session.advanced.load_into_stream()andload_starting_with_into_stream()were broken: the implementation was reading from the output stream instead of writing to it, so callers always received an empty result. Fixed to serialize documents and write them to the provided stream.RDBC-1038 – Adds
session.advanced.stream_into(query, output), which streams query results incrementally to an output stream without buffering the full result set in memory. Also addsDocumentQuery.to_stream()andRawDocumentQuery.to_stream()as convenience wrappers. The output format matches the C#StreamIntowire format ({"Results":[...]}).Type of change
How risky is the change?
Backward compatibility
Is it platform specific issue?
Documentation update
Documentation Requiredtag.Testing by Contributor
private)Testing by RavenDB QA team
QA Requiredtag.Is there any existing behavior change of other features due to this change?
UI work
Studio Requiredtag.