Skip to content

Commit 0778c54

Browse files
committed
chore(cubestore): Upgrade DF: In compaction, limit batch size to 2048
1 parent c718563 commit 0778c54

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

rust/cubestore/cubestore/src/store/compaction.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,13 @@ impl CompactionService for CompactionServiceImpl {
678678
.metadata_cache_factory
679679
.cache_factory()
680680
.make_session_config();
681+
const MAX_BATCH_ROWS: usize = 2048;
682+
// Set batch size to 2048 to avoid overflow in case where, perhaps, we might get repeated
683+
// large string values, such that the default value, 8192, could produce an array too big
684+
// for i32 string array offsets in a SortPreservingMergeExecStream that is constructed in
685+
// `merge_chunks`. In pre-DF-upgrade Cubestore, MergeSortExec used a local variable,
686+
// MAX_BATCH_ROWS = 4096, which might be small enough.
687+
let session_config = session_config.with_batch_size(MAX_BATCH_ROWS);
681688

682689
// Merge and write rows.
683690
let schema = Arc::new(arrow_schema(index.get_row()));

0 commit comments

Comments
 (0)