Generate HTTP Range header values for fetching specific columns. Returns `(column_name, "bytes=offset-end")` pairs for use with S3 GetObject or HTTP range requests. Note: for encrypted packed files, these range headers address the ciphertext. Column-level reads require full payload decryption on the client side.
(footer: &PackedFooter, columns: &[&str])
| 423 | /// ciphertext. Column-level reads require full payload decryption |
| 424 | /// on the client side. |
| 425 | pub fn http_range_headers(footer: &PackedFooter, columns: &[&str]) -> Vec<(String, String)> { |
| 426 | columns |
| 427 | .iter() |
| 428 | .filter_map(|&name| { |
| 429 | footer.column_ranges.get(name).map(|&(offset, length)| { |
| 430 | let end = offset + length - 1; // HTTP ranges are inclusive. |
| 431 | (name.to_string(), format!("bytes={offset}-{end}")) |
| 432 | }) |
| 433 | }) |
| 434 | .collect() |
| 435 | } |
| 436 | |
| 437 | // ── Tests ───────────────────────────────────────────────────────────────────── |
| 438 |