Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ed6d5dd
[core] Bound queued BLOB split batches by a shared byte budget
XiaoHongbo-Hope Nov 24, 2026
baea228
Scale default BLOB output budget with available cores
XiaoHongbo-Hope Nov 25, 2026
3dc86a0
Scale BLOB output budget to eight cores
XiaoHongbo-Hope Nov 25, 2026
ad94730
Preserve BLOB budgets for mixed splits and defer reader creation
XiaoHongbo-Hope Nov 25, 2026
7db2e9a
Charge known BLOBs in mixed split groups
XiaoHongbo-Hope Nov 25, 2026
579eb72
Charge BLOB output budget only for read columns
XiaoHongbo-Hope Nov 25, 2026
17ea8f1
Preserve known BLOB cost in mixed-size splits
XiaoHongbo-Hope Nov 25, 2026
6006685
Keep known BLOB budget with REST views
XiaoHongbo-Hope Nov 25, 2026
b26fc71
Avoid cloning split in budget assertions
XiaoHongbo-Hope Nov 25, 2026
da9a092
Keep BLOB reservations for live split readers
XiaoHongbo-Hope Nov 25, 2026
ddfd312
Fix Clippy lint in BLOB reservation regression test
XiaoHongbo-Hope Nov 25, 2026
dce1d6b
Apply the BLOB output budget to aliased projections
XiaoHongbo-Hope Nov 27, 2026
f4206fe
Merge upstream main and preserve the shared BLOB budget
XiaoHongbo-Hope Nov 27, 2026
3e4b260
Admit fitting BLOB groups in unordered reads
XiaoHongbo-Hope Nov 28, 2026
6248c4a
Budget historical BLOB files by physical field ID
XiaoHongbo-Hope Nov 28, 2026
3ded898
Prepare historical BLOB schemas without blocking other read groups
XiaoHongbo-Hope Nov 28, 2026
e906a58
Prepare BLOB schemas one split at a time within unordered read groups
XiaoHongbo-Hope Nov 28, 2026
fe83adb
Prepare historical BLOB schemas lazily in ordered reads
XiaoHongbo-Hope Nov 28, 2026
a667e24
Budget active BLOB splits and retain parallel reads of independent files
XiaoHongbo-Hope Nov 29, 2026
d7640af
Account for physical BLOB payloads before admitting file reads
XiaoHongbo-Hope Dec 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bindings/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ print(f"\nRead: {batches_tt[0].num_rows} rows")
print(batches_tt[0])
```

Parallel BLOB reads with known sizes share a `read.blob.output.max-buffered-bytes`
budget (default 512 MiB per available core, capped at 4 GiB). Pure unknown-size
groups retain split concurrency unless this option is explicitly set, which
makes them run alone. Known-size BLOBs remain budgeted when grouped with
unknown-size splits. Oversized groups also run alone. Decoder memory and
caller-held batches are excluded; descriptor reads are unaffected.

### Scan statistics

Every scan collects lightweight counters during ordinary metadata planning:
Expand Down
88 changes: 88 additions & 0 deletions crates/paimon/src/spec/core_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ const PARQUET_WRITE_PAGE_INDEX_ENABLED_OPTION: &str = "parquet.write-page-index.
const PARQUET_ROW_GROUP_PARALLELISM_OPTION: &str = "read.parquet.row-group.parallelism";
pub(crate) const PARQUET_ROW_GROUP_MAX_INFLIGHT_BYTES_OPTION: &str =
"read.parquet.row-group.max-inflight-bytes";
const BLOB_OUTPUT_MAX_BUFFERED_BYTES_OPTION: &str = "read.blob.output.max-buffered-bytes";
const BLOB_OUTPUT_BYTES_PER_CORE: i64 = 512 * 1024 * 1024;
const MOSAIC_READ_PREFETCH_ROW_GROUPS_OPTION: &str = "mosaic.read.prefetch-row-groups";
pub(crate) const MOSAIC_READ_PREFETCH_MAX_BYTES_OPTION: &str = "mosaic.read.prefetch-max-bytes";
pub(crate) const TABLE_READ_SEQUENCE_NUMBER_ENABLED_OPTION: &str =
Expand Down Expand Up @@ -384,6 +386,10 @@ pub(crate) enum TimeTravelSelector<'a> {
},
}

fn default_blob_output_max_buffered_bytes(available_cores: usize) -> i64 {
(available_cores.clamp(1, 8) as i64) * BLOB_OUTPUT_BYTES_PER_CORE
}

impl<'a> CoreOptions<'a> {
pub fn new(options: &'a HashMap<String, String>) -> Self {
Self { options }
Expand Down Expand Up @@ -528,6 +534,39 @@ impl<'a> CoreOptions<'a> {
})
}

/// Bytes reserved for BLOB batches waiting at the parallel split executor.
/// The default is 512 MiB per available core, capped at 4 GiB;
/// an explicit option always overrides it.
pub fn blob_output_max_buffered_bytes(&self) -> crate::Result<u64> {
let value = match self.options.get(BLOB_OUTPUT_MAX_BUFFERED_BYTES_OPTION) {
Some(raw) => parse_memory_size(raw).ok_or_else(|| crate::Error::DataInvalid {
message: format!(
"Option '{BLOB_OUTPUT_MAX_BUFFERED_BYTES_OPTION}' must be a valid memory size, got: {raw}"
),
source: None,
})?,
None => default_blob_output_max_buffered_bytes(
std::thread::available_parallelism()
.map(|value| value.get())
.unwrap_or(1),
),
};
u64::try_from(value)
.ok()
.filter(|value| *value > 0 && value.div_ceil(1024 * 1024) <= u32::MAX as u64)
.ok_or_else(|| crate::Error::DataInvalid {
message: format!(
"Option '{BLOB_OUTPUT_MAX_BUFFERED_BYTES_OPTION}' must be positive and fit in the read semaphore, got: {value}"
),
source: None,
})
}

pub(crate) fn blob_output_budget_serializes_unknown(&self) -> bool {
self.options
.contains_key(BLOB_OUTPUT_MAX_BUFFERED_BYTES_OPTION)
}

/// Reject scan options whose semantics the Rust core does not yet implement.
///
/// These are not malformed input — they are unimplemented scan modes — so
Expand Down Expand Up @@ -2517,6 +2556,55 @@ mod tests {
}
}

#[test]
fn test_blob_output_buffer_budget_option() {
let options = HashMap::new();
assert_eq!(
CoreOptions::new(&options)
.blob_output_max_buffered_bytes()
.unwrap(),
default_blob_output_max_buffered_bytes(
std::thread::available_parallelism()
.map(|value| value.get())
.unwrap_or(1)
) as u64
);
for (cores, mib) in [
(0, 512),
(1, 512),
(2, 1024),
(4, 2048),
(8, 4096),
(16, 4096),
] {
assert_eq!(
default_blob_output_max_buffered_bytes(cores),
mib * 1024 * 1024
);
}
assert!(!CoreOptions::new(&options).blob_output_budget_serializes_unknown());
let options = HashMap::from([(
BLOB_OUTPUT_MAX_BUFFERED_BYTES_OPTION.to_string(),
"32 mb".to_string(),
)]);
assert_eq!(
CoreOptions::new(&options)
.blob_output_max_buffered_bytes()
.unwrap(),
32 * 1024 * 1024
);
assert!(CoreOptions::new(&options).blob_output_budget_serializes_unknown());
for value in ["0", "-1", "invalid", "9223372036854775807 tb"] {
let options = HashMap::from([(
BLOB_OUTPUT_MAX_BUFFERED_BYTES_OPTION.to_string(),
value.to_string(),
)]);
assert!(CoreOptions::new(&options)
.blob_output_max_buffered_bytes()
.is_err());
}
}

#[test]
fn test_parquet_filter_column_index_enabled() {
let options = HashMap::new();
Expand Down
11 changes: 9 additions & 2 deletions crates/paimon/src/table/data_evolution_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2233,10 +2233,14 @@ fn read_bunch_files_stream(
for file in files {
let deletion_vector =
shifted_deletion_vector_for_file(&file, anchor_deletion_vector.as_ref())?;
let file_fields = match &data_fields {
Some(fields) => Some(fields.clone()),
None => file_reader.derive_data_fields(&file).await?,
};
let mut stream = file_reader.read_single_file_stream(
&split,
file,
data_fields.clone(),
file_fields,
deletion_vector,
row_ranges.clone(),
)?;
Expand Down Expand Up @@ -2555,7 +2559,10 @@ async fn load_file_infos(
Ok((infos, nested_enabled))
}

fn resolve_field_ids(file: &DataFileMeta, fields: &[DataField]) -> crate::Result<Vec<i32>> {
pub(super) fn resolve_field_ids(
file: &DataFileMeta,
fields: &[DataField],
) -> crate::Result<Vec<i32>> {
match &file.write_cols {
Some(write_cols) => Ok(
super::data_evolution_fields::project_by_paths(fields, write_cols)?
Expand Down
Loading
Loading