Expand description
Bounded profiling: turn a SQL dump’s column values into fixed-size, generator-neutral evidence.
The profiler scans data and accumulates bounded sketches
(ColumnSketches) whose memory does not grow with input size — a column
spanning a billion rows costs the same as one spanning a thousand. The
result is a tree of neutral evidence structs: observations and
confidence only, with no opinion about how to regenerate the data. Later
stages (schema inference, generation heuristics) consume that evidence
without depending on how it was collected.
The three properties this module guarantees, enforced by
tests/generate_profile_test.rs:
- Bounded — retained items and bytes stay within the
ProfileBudget. - Mergeable — sketches over disjoint partitions merge into the same bounded evidence as a single pass (exactly, for the non-sampled parts).
- Seeded — the same seed yields the same reservoir sample.
Re-exports§
pub use evidence::BooleanEvidence;pub use evidence::CharClasses;pub use evidence::ColumnEvidence;pub use evidence::DumpProfile;pub use evidence::NumericEvidence;pub use evidence::RelationshipEvidence;pub use evidence::StringShapeEvidence;pub use evidence::TableEvidence;pub use evidence::TimestampRangeEvidence;pub use evidence::TopKEntry;pub use heuristics::Confidence;pub use heuristics::Decision;pub use heuristics::InferenceError;pub use heuristics::InferenceOptions;pub use heuristics::InferenceResult;pub use heuristics::ModelInference;pub use heuristics::Precedence;pub use heuristics::RejectedCandidate;
Modules§
- evidence
- Neutral profiling evidence: observations and confidence only.
- heuristics
- Turn a neutral
DumpProfileinto an explicit, self-containedSyntheticModelthrough a set of small, registered heuristics.
Structs§
- Column
Sketches - All per-column accumulators bundled behind one seeded, mergeable, bounded
facade. Feed values with
observe; combine partitions withmerge; finalize toColumnEvidencewithfinish. - Dump
Profiler - Streams a SQL dump into a
DumpProfile. Build one withDumpProfiler::builder. - Dump
Profiler Builder - Builder for
DumpProfiler. - Profile
Budget - Per-column bounds on how much the profiler may retain. Every accumulator is sized from these three knobs; the derived methods report the resulting item and byte ceilings.
Enums§
- Profile
Depth - How deeply to profile a dump.
- Profile
Error - Errors from building or combining profile evidence.
- Profile
Value - A single observed column value, borrowed for the duration of the call.