branch-4.1: [fix](mc) fix memory leak and optimize large data write for MaxCompute connector (#61245)#61745
Merged
morningman merged 1 commit intoapache:branch-4.1from Mar 27, 2026
Merged
Conversation
…e connector (apache#61245) ### What problem does this PR solve? Fix: - Fix potential memory leak in MaxComputeJniScanner by closing currentSplitReader in close(). - Fix potential memory leak in MaxComputeJniWriter by restructuring close() with try-finally to ensure allocator is always closed even when batchWriter.commit() throws. Also close VectorSchemaRoot after each batch write. - Fix maxWriteBatchRows parameter key mismatch between BE ("max_write_batch_rows") and JNI ("mc.max_write_batch_rows"), which caused user-customized values to be silently ignored. Optimization: - Split large Arrow batches into smaller chunks (controlled by mc.max_write_batch_rows, default 4096) to avoid HTTP 413 Request Entity Too Large errors from MaxCompute Storage API. - Skip unnecessary SORT node for static partition INSERT, since all data goes to a single known partition and no dynamic routing is needed. - Enable ZSTD compression for Arrow data transfer to reduce network bandwidth. New catalog properties: - mc.max_write_batch_rows: max rows per Arrow batch for write (default: 4096) - mc.max_field_size_bytes: max field size in bytes for write session (default: 8MB) Co-authored-by: daidai <changyuwei@selectdb.com>
Contributor
Author
|
run buildall |
Contributor
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
yiguolei
approved these changes
Mar 26, 2026
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
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.
bp #61245