(
&self,
partitions: &[HashMap<String, Option<Datum>>],
)
| 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<()> { |
no test coverage detected