Documentation
¶
Overview ¶
Package source decodes replayable objects into bounded, owned Arrow batches.
Index ¶
- func ParseTimestamp(s string, c config.Column) (time.Time, error)
- type Dataset
- func (d *Dataset) ApplyStatisticsPlan(ctx context.Context, plan *data.StatisticsPlan) error
- func (d *Dataset) Close() error
- func (d *Dataset) DecoderPassesPerOpen() int
- func (d *Dataset) InferenceRowsScanned() uint64
- func (d *Dataset) Objects() []storage.Object
- func (d *Dataset) Open(ctx context.Context) (Reader, error)
- func (d *Dataset) OpenPreflight(ctx context.Context) (Reader, error)
- func (d *Dataset) ParquetGroups() ([]data.ParquetGroup, error)
- func (d *Dataset) Passes() int
- func (d *Dataset) Schema() *arrow.Schema
- func (d *Dataset) SchemaIssues() []data.Issue
- func (d *Dataset) VerifyStatisticsInputs(ctx context.Context) error
- type Option
- type Reader
- type SchemaAttributes
- type SchemaCheck
- type SchemaDifference
- type SchemaField
- type SchemaObject
- type SchemaReport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dataset ¶
type Dataset struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctx context.Context, cfg *config.Config, store *storage.Store, budget *resource.Budget, opts ...Option) (*Dataset, error)
New discovers the configured objects and freezes the dataset schema, either from input.schema or by inspecting headers and sampling records.
func NewGenerated ¶
func (*Dataset) ApplyStatisticsPlan ¶
ApplyStatisticsPlan retains an immutable, complete, source-ordered plan. A prepass has already required ordinary values and cannot later be short-cut. Baselines for fully scanned inputs are established first; the plan is only committed once they succeed, so a failed call leaves no plan applied.
func (*Dataset) DecoderPassesPerOpen ¶
DecoderPassesPerOpen counts complete scans surrounding Parquet decoding. Page verification is fused with decoding; only local replay digests require an additional complete scan.
func (*Dataset) InferenceRowsScanned ¶
InferenceRowsScanned counts successful decoded row visits during schema inference/discovery, including the lexical drain after the sample limit. Raw identity/hash passes and later readers are not included.
func (*Dataset) OpenPreflight ¶
OpenPreflight preserves conversion states for whole-dataset castability gates.
func (*Dataset) ParquetGroups ¶
func (d *Dataset) ParquetGroups() ([]data.ParquetGroup, error)
ParquetGroups borrows guarded facts whose lifetime is the dataset. It never reads payload and does not confer trust; only a complete checks plan can skip.
func (*Dataset) Passes ¶
Passes reports source passes spent before the main read (schema inference).
func (*Dataset) SchemaIssues ¶
type Option ¶
type Option func(*options)
Option configures New.
func WithLogger ¶
WithLogger sets the logger for discovery, inference and Parquet safety scan events. Row values are never logged.
type SchemaAttributes ¶
type SchemaAttributes struct {
Type string `json:"type"`
ArrowType string `json:"arrow_type,omitempty"`
PhysicalType string `json:"physical_type,omitempty"`
Nullable *bool `json:"nullable"`
Required *bool `json:"required"`
BitWidth *int `json:"bit_width"`
Signed *bool `json:"signed"`
Precision *int32 `json:"precision"`
Scale *int32 `json:"scale"`
Unit *string `json:"unit"`
Timezone *string `json:"timezone"`
}
SchemaAttributes records the logical domain without inventing absent constraints. A nil attribute means the expectation does not constrain it.
type SchemaCheck ¶
type SchemaCheck struct {
Code string `json:"code"`
Type string `json:"type"`
Source string `json:"source,omitempty"`
Status string `json:"status"`
Reason string `json:"reason,omitempty"`
}
SchemaCheck explicitly separates metadata outcomes from unevaluated checks.
type SchemaDifference ¶
type SchemaDifference struct {
SourceOrdinal uint64 `json:"source_ordinal"`
Source string `json:"source"`
Column string `json:"column"`
SourceName string `json:"source_name,omitempty"`
Kind string `json:"kind"`
Expected *SchemaAttributes `json:"expected"`
Actual *SchemaAttributes `json:"actual"`
Severity string `json:"severity"`
RuleCode string `json:"rule_code,omitempty"`
ExpectationSource string `json:"expectation_source"`
Reason string `json:"reason"`
RuleOrdinal int `json:"rule_ordinal,omitempty"`
CheckOrdinal int `json:"check_ordinal,omitempty"`
}
SchemaDifference is a policy-relevant mismatch, not a value-validation outcome. Expected/Actual are null when no typed schema exists on that side.
type SchemaField ¶
type SchemaField struct {
Name string `json:"name"`
SourceName string `json:"source_name,omitempty"`
Type string `json:"type"`
ArrowType string `json:"arrow_type"`
PhysicalType string `json:"physical_type,omitempty"`
Nullable bool `json:"nullable"`
Required bool `json:"required,omitempty"`
Attributes *SchemaAttributes `json:"attributes"`
}
SchemaField preserves the actual source name separately from its renamed name.
type SchemaObject ¶
type SchemaObject struct {
SourceOrdinal uint64 `json:"source_ordinal"`
URI string `json:"uri"`
DeclaredRows int64 `json:"declared_rows"`
Fields []SchemaField `json:"fields"`
}
SchemaObject is the metadata observed for one pinned input object.
type SchemaReport ¶
type SchemaReport struct {
ReportVersion int `json:"report_version"`
RunID string `json:"run_id"`
Scope string `json:"scope"`
MetadataOnly bool `json:"metadata_only"`
Validation string `json:"validation"`
Compatible bool `json:"compatible"`
RowsChecked int64 `json:"rows_checked"`
ObjectsChecked int `json:"objects_checked"`
DeclaredRows int64 `json:"declared_rows"`
Objects []SchemaObject `json:"objects"`
DeclaredSchema []SchemaField `json:"declared_schema"`
SchemaIssues []data.Issue `json:"schema_issues"`
Checks []SchemaCheck `json:"checks"`
NotEvaluated []SchemaCheck `json:"not_evaluated"`
Differences []SchemaDifference `json:"differences"`
BaselineSource string `json:"baseline_source,omitempty"`
BaselineSourceOrdinal uint64 `json:"baseline_source_ordinal,omitempty"`
// contains filtered or unexported fields
}
SchemaReport describes only footer/schema compatibility, never row validation. DeclaredRows is the footer claim, not an observed or validated row count.
func InspectSchema ¶
func InspectSchema(ctx context.Context, cfg *config.Config, store *storage.Store, budget *resource.Budget) (report *SchemaReport, err error)
InspectSchema reads Parquet footers only. It neither opens a row reader nor compiles checks, loads rule references, validates pages or hashes input data. cfg must already be validated; store and budget remain owned by the caller. The caller must Release the returned report after presentation.
func (*SchemaReport) Release ¶
func (r *SchemaReport) Release()
Release returns the report's managed reservations. It is idempotent; the report must not be used afterward. No source handles or dataset state remain attached to a completed report.