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

Function batch_hash_codes

crates/paimon/src/spec/binary_row.rs:1143–1150  ·  view source on GitHub ↗

Batch-compute Murmur3 hash codes for all rows. Returns one `i32` per row, identical to calling `BinaryRow::from_arrow(batch, row_idx, field_indices, fields).hash_code()` for each row, but with O(F) column downcasts instead of O(N*F).

(
    batch: &RecordBatch,
    field_indices: &[usize],
    fields: &[crate::spec::DataField],
)

Source from the content-addressed store, hash-verified

1141/// `BinaryRow::from_arrow(batch, row_idx, field_indices, fields).hash_code()`
1142/// for each row, but with O(F) column downcasts instead of O(N*F).
1143pub fn batch_hash_codes(
1144 batch: &RecordBatch,
1145 field_indices: &[usize],
1146 fields: &[crate::spec::DataField],
1147) -> crate::Result<Vec<i32>> {
1148 let rows = batch_build_binary_rows(batch, field_indices, fields)?;
1149 Ok(rows.into_iter().map(|r| r.hash_code()).collect())
1150}
1151
1152#[cfg(test)]
1153mod tests {

Callers 3

assign_batchMethod · 0.85
assign_batchMethod · 0.85

Calls 2

batch_build_binary_rowsFunction · 0.85
hash_codeMethod · 0.80

Tested by

no test coverage detected