Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions bindings/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ print(f"\nRead: {batches_tt[0].num_rows} rows")
print(batches_tt[0])
```

Parallel BLOB reads share a `read.blob.output.max-buffered-bytes` budget
(default `256mb`). Unknown-size or oversized groups 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
53 changes: 53 additions & 0 deletions crates/paimon/src/spec/core_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ 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 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 @@ -527,6 +528,28 @@ impl<'a> CoreOptions<'a> {
})
}

/// Bytes reserved for BLOB batches waiting at the parallel split executor.
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 => 256 * 1024 * 1024,
};
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,
})
}

/// 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 @@ -2510,6 +2533,36 @@ 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(),
256 * 1024 * 1024
);
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
);
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
Loading
Loading