Skip to main content

reifydb_core/value/column/
headers.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2026 ReifyDB
3
4use arrow_array::RecordBatch;
5use reifydb_value::fragment::Fragment;
6
7#[derive(Debug, Clone)]
8pub struct ColumnHeaders {
9	pub columns: Vec<Fragment>,
10}
11
12impl ColumnHeaders {
13	pub fn from_batch(batch: &RecordBatch) -> Self {
14		Self {
15			columns: batch
16				.schema_ref()
17				.fields()
18				.iter()
19				.map(|field| Fragment::internal(field.name()))
20				.collect(),
21		}
22	}
23
24	pub fn empty() -> Self {
25		Self {
26			columns: Vec::new(),
27		}
28	}
29}