table
Column-oriented tables. A Table is named, ordered Columns of one
length; each column is one typed List (i64, f64, bool, str,
dictionary-encoded str, date, datetime) plus a validity bitmap for
nulls. Operations run a column at a time; grouping and joins hash
rows into integer keys first (keys), so no per-row allocation.
Modules
arrowArrow IPC: the file format (.arrow, Feather v2) and the streaming format, read and written without an Arrow library.buildBuilding tables: thetable!literal, records of a struct (#[derive(Record)], orRecordby hand), cells from Nabi values.columnTyped column storage: one packedListper column plus an optional validity bitmap.csvCSV (RFC 4180) through thecsvpackage: a header line, any one-byte delimiter,"-quoted fields with""for a quote and line breaks inside, LF / CRLF / CR line ends, a UTF-8 BOM skipped.dateCalendar dates and timestamps in the proleptic Gregorian calendar, UTC, with no leap seconds.displayText forms of a table: the aligned previewDisplayprints (rows and columns cut in the middle past a limit) and GitHub-flavoured Markdown.errorThe one error type.exprColumn expressions: a small tree built with the dot operators (col("x") .* 2 .+ col("y"),col("a") .> 3 .&& col("b") .== "k") and evaluated column at a time against a table.frameThe table: named, ordered columns of one length, and the operations that only reshape rows or columns (selection, slicing, nulls).groupGroup-by and aggregation.joinHash joins.jsonlJSON lines: one JSON object per line, a row each.lazyLazy queries: aQueryrecords the operations of a table pipeline as a plan and runs it only oncollect, after an optimizer has moved filters as early as they can go (into a file scan, where Parquet row groups whose statistics rule a filter out are not read) and pruned every column nothing downstream uses (a scan reads only those).opsRelational algebra as operators: the join symbols of Codd's algebra (⋈ ⟕ ⟖ ⟗ ⋉ ▷), the set operators (∪ ∩from core,∖here) and indexing by column name.parquetParquet files, read and written without a Parquet library.reshapeLong <-> wide:pivotspreads one column's values into columns,meltstacks columns into (variable, value) rows.schemaColumn types and the schema of a table.sortSorting: every key becomes an order-preserving u64 per row (numbers by their bits, strings by rank among the distinct values), then a stable LSD radix sort of (key, row) pairs, last key first.statsSummaries:describe,value_counts,null_counts.valueOne cell, the element type of rows and the scalar of expressions.
Re-exports
arrow::{Arrow, arrow_schema, read_arrow, write_arrow}Source
pub use arrow::{Arrow, arrow_schema, read_arrow, write_arrow}ArrowHow to read or write Arrow IPC data.arrow_schemaThe schema of the Arrow data inb, without reading its rows.read_arrowThe Arrow file (or stream) atpath:Arrow::new().read_file(path).write_arrowWritettopathin the Arrow file format.
build::{Record, ToValue, record_table}Source
pub use build::{Record, ToValue, record_table}RecordA struct whose values are rows:#[derive(table::Record)]writes it from the fields (each aToValuetype), or implement it by hand.ToValueA Nabi value that is one cell.record_tableA table with one row per record; the column types come from the struct, so an empty list still has the columns.
column::ColumnSource
pub use column::ColumnColumnOne typed column.
csv::{Csv, CsvReader, read_csv, read_csv_str, write_csv}Source
pub use csv::{Csv, CsvReader, read_csv, read_csv_str, write_csv}CsvHow to read or write CSV.CsvReaderReads CSV from a stream in batches.read_csvRead the CSV file atpathwith the default options.read_csv_strA table from CSV text with the default options.write_csvWrite the table as CSV topathwith the default options.
date::{Date, DateTime}Source
pub use date::{Date, DateTime}error::TableErrorSource
pub use error::TableErrorTableErrorWhat went wrong in a table operation.
expr::{Expr, IntoExpr, Then, When, col, lit, when}Source
pub use expr::{Expr, IntoExpr, Then, When, col, lit, when}ExprA computed column: names columns withcol, scalars withlit(or a plain number, string, bool or date on either side of an operator), and combines them with the dot operators.IntoExprWhat can stand on either side of an expression operator: anExpr, a number, string, bool, date orValue.ThenAwhen(..).then(..)waiting for itsotherwise.WhenAwhen(..)waiting for itsthen.colColumnnameof the table the expression runs against.litA scalar, the same in every row.whenthenwherecondistrue, elseotherwise; start withwhen.
frame::{Row, Table}Source
pub use frame::{Row, Table}group::{Agg, AggKind, GroupBy, count, count_of, custom, first, last, max, mean, median, min, n_unique, quantile, std, sum, var}Source
pub use group::{Agg, AggKind, GroupBy, count, count_of, custom, first, last, max, mean, median, min, n_unique, quantile, std, sum, var}AggOne aggregation: a kind, its input column and the output name (<column>_<kind>unlessnamed).AggKindWhat an aggregation computes.GroupByA table split into groups by key columns, ready to aggregate.countRows per group, namedcount.count_ofNon-null values ofcper group.customfof each group's slice of columnc, namedname.firstThe first non-null value.lastThe last non-null value.maxLargest value, any orderable type.meanArithmetic mean, compensated sum over the count.medianThe 0.5 quantile, linear interpolation.minSmallest value, any orderable type.n_uniqueHow many distinct non-null values.quantileTheqquantile (0 <= q <= 1), linear interpolation.stdSample standard deviation, Welford's one-pass update.sumSum (i64staysi64;f64with Neumaier compensation).varSample variance (n - 1), Welford.
join::HowSource
pub use join::HowHowWhich rows a join keeps.
jsonl::{read_jsonl, read_jsonl_str, write_jsonl, write_jsonl_str}Source
pub use jsonl::{read_jsonl, read_jsonl_str, write_jsonl, write_jsonl_str}read_jsonlThe JSON lines file atpathas a table.read_jsonl_strA table from JSON lines text; blank lines are skipped.write_jsonlWrite the table as JSON lines topath.write_jsonl_strThe table as JSON lines, one object per row, each line ended by\n.
lazy::{LazyGroupBy, Query, scan_arrow, scan_csv, scan_parquet}Source
pub use lazy::{LazyGroupBy, Query, scan_arrow, scan_csv, scan_parquet}LazyGroupByA query grouped by key columns, waiting for its aggregations.QueryA table pipeline that runs oncollect.scan_arrowArrow::new().scan(path).scan_csvCsv::new().scan(path).scan_parquetParquet::new().scan(path).
parquet::{Compression, Parquet, parquet_schema, read_parquet, write_parquet}Source
pub use parquet::{Compression, Parquet, parquet_schema, read_parquet, write_parquet}CompressionThe page compression a written file uses.ParquetHow to read or write Parquet.parquet_schemaThe schema of the Parquet data inb(its readable columns), from the footer alone.read_parquetThe Parquet file atpath:Parquet::new().read_file(path).write_parquetWritettopathas Parquet with the defaults ofParquet::new().
schema::{DType, Field, Schema}Source
pub use schema::{DType, Field, Schema}sort::{SortKey, asc, desc}Source
pub use sort::{SortKey, asc, desc}value::ValueSource
pub use value::ValueValueA single cell.