InferredSchema

The model the catalog derives from the store's segments.

This is the answer to "what is actually in there", and it is produced by folding the per-segment sketches rather than by scanning — so asking for it costs the fold, not the data.

Two approximations are inherent and are not bugs. A key that has been overwritten but not yet compacted is counted once per segment that holds a live version, and a deleted document's earlier contribution survives until compaction drops the superseded version. Both have the same cause — an LSM tree holds several versions of a key until it merges them — and the same fix, which is DocumentStore.compact(). Against an append-only or compacted store the counts are exact.

Properties

Link copied to clipboard

How much of the store contributed. See CatalogCoverage.

Link copied to clipboard

Documents the model accounts for. See the class documentation for what "accounts for" means.

Link copied to clipboard

Every tracked path, in canonical order.

Link copied to clipboard

Whether any path was dropped for exceeding the budget.

Link copied to clipboard

Observations that belonged to a dropped path.

Link copied to clipboard

Estimated distinct paths dropped for exceeding CatalogOptions.maxPaths.

Functions

Link copied to clipboard
operator fun get(path: CatalogPath): InferredField?

The field at path, or null if the catalog does not track it.

operator fun get(expression: String): InferredField?

The field at the path expression parses to. See CatalogPath.parse.

Link copied to clipboard
fun render(): String

A human-readable table, for a report or a failing assertion.

Link copied to clipboard
fun required(fraction: Double = 1.0): List<InferredField>

Fields present in at least fraction of documents, most present first.

Link copied to clipboard
open override fun toString(): String