pub struct DatasetSchema {Show 17 fields
pub schema: Arc<Schema>,
pub columns: Vec<ColumnDrift>,
pub omitted: Vec<Vec<(PlSmallStr, DataType)>>,
pub unreadable: Vec<usize>,
pub files: usize,
pub groups: Vec<DriftGroup>,
pub file_group: Vec<u32>,
pub origin: SchemaOrigin,
pub read_as_text: Vec<PlSmallStr>,
pub empty_files: usize,
pub median_row_group_bytes: Option<usize>,
pub median_file_bytes: Option<usize>,
pub column_ranges: HashMap<PlSmallStr, ColumnRange>,
pub partition_layouts: Vec<(Vec<String>, usize)>,
pub partition_layouts_dropped: (usize, usize),
pub skipped: SkippedFiles,
pub listed_files: usize,
}Expand description
One dataset’s schema, and what deciding it revealed.
Fields§
§schema: Arc<Schema>§columns: Vec<ColumnDrift>§omitted: Vec<Vec<(PlSmallStr, DataType)>>Per file, in the order given, the columns not read from it and the type that file holds each of them in. Empty for a file whose types all fit.
The type is kept because it is the only way back to the values: reading such a column as text means reading it from each file at the type that file wrote, which the footers know and nothing else does.
unreadable: Vec<usize>Files whose footer could not be read, by index into the files given.
files: usizeFiles whose footer was read, readable or not.
groups: Vec<DriftGroup>The distinct ways this dataset’s files differ from its schema. Group 0 is always “nothing missing”, which is what a file not read counts as.
file_group: Vec<u32>Per file, in the order given, its group in groups.
origin: SchemaOrigin§read_as_text: Vec<PlSmallStr>Columns being read as text from every file rather than as the type most rows have. Empty for a dataset as its footers found it.
empty_files: usizeFiles whose footer said they hold no rows, among those read.
median_row_group_bytes: Option<usize>The middle row group’s compressed size, over every row group of every footer
read. None when no footer reported one.
median_file_bytes: Option<usize>The middle file’s size, over the footers read. None when none was read.
column_ranges: HashMap<PlSmallStr, ColumnRange>Where each column that is not in every file sits, for those whose files fall into a shape worth naming. Empty for a dataset with no partitions, and for one whose footers were sampled — a file whose footer was not read looks like a file missing nothing, and a range drawn over those would be a guess.
partition_layouts: Vec<(Vec<String>, usize)>The distinct ways the dataset’s files are partitioned, and how many files are laid out each way, commonest first. One entry, or none, for a dataset whose directories agree — which is nearly all of them.
From the names of every file, not from the footers: this is the one thing the listing knows that reading a file cannot tell you.
partition_layouts_dropped: (usize, usize)The layouts past the ones kept, and the files under them. A dataset with a key per file is not worth remembering in full, but a note that counts what it does not name has to count all of it.
skipped: SkippedFilesWhat the listing passed over on the way to the files it read. From the listing, which had to look at every name anyway.
listed_files: usizeHow many file names were read to find the layouts, including the ones with no partition keys at all.
Implementations§
Source§impl DatasetSchema
impl DatasetSchema
Sourcepub fn drifting(&self) -> impl Iterator<Item = &ColumnDrift>
pub fn drifting(&self) -> impl Iterator<Item = &ColumnDrift>
Columns that are not in every file, or whose type had to give way.
Sourcepub fn with_partition_layouts(
self,
root: &str,
paths: &[String],
) -> DatasetSchema
pub fn with_partition_layouts( self, root: &str, paths: &[String], ) -> DatasetSchema
The dataset with the ways its files are partitioned counted from their names.
root is the dataset as opened; the keys are taken from below it. A directory
above the root is not in dispute — opening run=7/ for a dataset partitioned
by date does not make run one of the things its directories disagree about, and
counting it made every file look like it disagreed with every other.
Keys are compared as a set: y=1/m=1 and m=2/y=2 partition by the same two
things and Polars matches hive columns by name, not position, so a dataset that
mixes the orders reads perfectly well and has nothing to disagree about.
Sourcepub fn with_skipped(self, skipped: SkippedFiles) -> DatasetSchema
pub fn with_skipped(self, skipped: SkippedFiles) -> DatasetSchema
Record what the listing passed over. See SkippedFiles.
Sourcepub fn reading_as_text(&self, as_text: &[PlSmallStr]) -> DatasetSchema
pub fn reading_as_text(&self, as_text: &[PlSmallStr]) -> DatasetSchema
This dataset as it reads with as_text read as text from every file.
What the panel shows and what the table draws from, not what the scan is built
from — the scan needs the types the footers found, which is why omitted is
carried through untouched and why the caller keeps the original alongside.
Those columns stop conflicting: their cells hold a value from every file, so
nothing is unread, nothing is left out of a filter or sort, and the note that
said the column was not read there has nothing left to say. absent is left
alone — a file that never had the column still has none to show.
Trait Implementations§
Source§impl Clone for DatasetSchema
impl Clone for DatasetSchema
Auto Trait Implementations§
impl !RefUnwindSafe for DatasetSchema
impl !UnwindSafe for DatasetSchema
impl Freeze for DatasetSchema
impl Send for DatasetSchema
impl Sync for DatasetSchema
impl Unpin for DatasetSchema
impl UnsafeUnpin for DatasetSchema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more