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

Method partitions_to_bytes

crates/paimon/src/table/table_commit.rs:256–279  ·  view source on GitHub ↗
(
        &self,
        partitions: &[HashMap<String, Option<Datum>>],
    )

Source from the content-addressed store, hash-verified

254 }
255
256 fn partitions_to_bytes(
257 &self,
258 partitions: &[HashMap<String, Option<Datum>>],
259 ) -> HashSet<Vec<u8>> {
260 let partition_fields = self.table.schema().partition_fields();
261 let partition_keys = self.table.schema().partition_keys();
262 partitions
263 .iter()
264 .map(|p| {
265 let owned_datums: Vec<(Option<Datum>, DataType)> = partition_keys
266 .iter()
267 .enumerate()
268 .map(|(i, key)| {
269 let datum = p.get(key).cloned().flatten();
270 let dt = partition_fields[i].data_type().clone();
271 (datum, dt)
272 })
273 .collect();
274 let refs: Vec<(&Option<Datum>, &DataType)> =
275 owned_datums.iter().map(|(d, t)| (d, t)).collect();
276 datums_to_binary_row(&refs)
277 })
278 .collect()
279 }
280
281 /// Truncate the entire table (OVERWRITE with no filter, only deletes).
282 pub async fn truncate_table(&self) -> Result<()> {

Callers 2

overwriteMethod · 0.80
truncate_partitionsMethod · 0.80

Calls 7

datums_to_binary_rowFunction · 0.85
partition_fieldsMethod · 0.80
partition_keysMethod · 0.80
data_typeMethod · 0.80
schemaMethod · 0.45
iterMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected