MCPcopy Create free account
hub / github.com/apache/paimon-rust / expand_selected_row_ids

Function expand_selected_row_ids

crates/paimon/src/table/data_file_reader.rs:389–407  ·  view source on GitHub ↗

Expand row_ranges into a flat sequence of selected row IDs for a file. Intended for per-batch _ROW_ID attachment — callers should not pass whole-file ranges with millions of rows, as this allocates a Vec proportional to the selected range size.

(
    first_row_id: i64,
    row_count: i64,
    row_ranges: &[RowRange],
)

Source from the content-addressed store, hash-verified

387/// whole-file ranges with millions of rows, as this allocates a Vec<i64>
388/// proportional to the selected range size.
389pub(super) fn expand_selected_row_ids(
390 first_row_id: i64,
391 row_count: i64,
392 row_ranges: &[RowRange],
393) -> Vec<i64> {
394 if row_count == 0 {
395 return Vec::new();
396 }
397 let file_end = first_row_id + row_count - 1;
398 let mut ids = Vec::new();
399 for r in row_ranges {
400 let from = r.from().max(first_row_id);
401 let to = r.to().min(file_end);
402 for id in from..=to {
403 ids.push(id);
404 }
405 }
406 ids
407}
408
409pub(super) fn attach_row_id(
410 batch: RecordBatch,

Callers 1

count_selected_rowsFunction · 0.85

Calls 2

toMethod · 0.80
fromMethod · 0.45

Tested by

no test coverage detected