Documentation
¶
Overview ¶
Package data defines the run-scoped Arrow ownership and result contracts.
Index ¶
- Constants
- func CheckedAdd(a, b uint64) (uint64, error)
- type Batch
- type Bucket
- type CheckEvidence
- type ColumnState
- type ColumnStatistics
- type Coverage
- type DatasetResult
- type GroupEvidence
- type Issue
- type Location
- type ParquetGroup
- type Result
- type RowMaterialization
- type RuleCoverage
- type State
- type StatisticsPlan
- type Summary
Constants ¶
const ( ReportVersion = 2 ScopeData = "data" ScopePlan = "plan" StatusCompleted = "completed" StatusSchemaRejected = "schema_rejected" ScopeRow = "row" ScopeSchema = "schema" ScopeDataset = "dataset" OriginRule = "rule" OriginIngest = "ingest" OriginDataset = "dataset" ValidationPass = "pass" ValidationFail = "fail" )
Report vocabulary shared by producers and the sink. The JSON spelling is the constant value.
Variables ¶
This section is empty.
Functions ¶
func CheckedAdd ¶
CheckedAdd rejects counter/provenance overflow instead of wrapping.
Types ¶
type Batch ¶
type Batch struct {
Record arrow.RecordBatch
States map[string][]State
Locations []Location
Raw []json.RawMessage
Ingest []Issue
Evidence *GroupEvidence
Cleanup func()
// contains filtered or unexported fields
}
Batch owns Record and bounded metadata. Release must be called on every path. States omitted for a column means use the Arrow validity bitmap (valid/null).
type Bucket ¶
type Bucket uint8
Bucket is the output partition chosen for one evaluated row.
func (Bucket) MarshalText ¶
MarshalText encodes b with its report spelling and rejects unknown buckets.
func (*Bucket) UnmarshalText ¶
UnmarshalText decodes the report spelling written by MarshalText.
type CheckEvidence ¶
type ColumnState ¶
type ColumnState struct {
// contains filtered or unexported fields
}
ColumnState binds ingestion overrides and Arrow validity once per batch. It borrows the batch's arrays and is valid only until Batch.Release.
func (ColumnState) State ¶
func (c ColumnState) State(row int) State
State returns the ingestion state of the bound row.
type ColumnStatistics ¶
type ColumnStatistics struct {
Name string
Type arrow.DataType
PhysicalType string
PhysicalLength int
NullCount *int64
NaNCount *int64
MinValue, MaxValue []byte
MinExact, MaxExact *bool
TypeDefinedOrder bool
LegacyOnly bool
}
ColumnStatistics borrows modern bounds from the guarded dataset footer. Optional fields preserve absence; no generated getter defaults are evidence.
type Coverage ¶
type Coverage struct {
ValueRows uint64 `json:"value_rows"`
MetadataClaimedRows uint64 `json:"metadata_claimed_rows"`
AccountedRows uint64 `json:"accounted_rows"`
RowGroupsScanned *uint64 `json:"row_groups_scanned"`
RowGroupsStatisticsOnly *uint64 `json:"row_groups_statistics_only"`
RowGroupsTotal *uint64 `json:"row_groups_total"`
}
Coverage separates decoded outcomes from producer-declared metadata claims.
type DatasetResult ¶
type DatasetResult struct {
Code string `json:"code"`
Metric string `json:"metric"`
Value any `json:"value"`
Status string `json:"status"`
Reason string `json:"reason,omitempty"`
Numerator uint64 `json:"numerator,omitempty"`
Denominator uint64 `json:"denominator,omitempty"`
Contributing uint64 `json:"contributing,omitempty"`
Excluded uint64 `json:"excluded,omitempty"`
NotApplicable uint64 `json:"not_applicable"`
Unevaluable uint64 `json:"unevaluable"`
}
type GroupEvidence ¶
type GroupEvidence struct {
SourceOrdinal uint64 `json:"source_ordinal"`
RowGroup uint64 `json:"row_group"`
DeclaredRows uint64 `json:"declared_rows"`
Source string `json:"source"`
IdentityMethod string `json:"identity_method"`
Identity map[string]string `json:"identity"`
Action string `json:"action"`
Reason string `json:"reason"`
Checks []CheckEvidence `json:"checks"`
IngestionVerification string `json:"ingestion_verification"`
PayloadVerification string `json:"payload_verification"`
}
type Issue ¶
type Issue struct {
Location
Code string `json:"code"`
Severity string `json:"severity"`
Origin string `json:"origin"`
Scope string `json:"scope"`
Column string `json:"column,omitempty"`
Message string `json:"message,omitempty"`
Reason string `json:"reason,omitempty"`
Count uint64 `json:"count,omitempty"`
}
type Location ¶
type Location struct {
Source string `json:"source"`
SourceOrdinal uint64 `json:"source_ordinal"`
Row uint64 `json:"row"`
GlobalRow uint64 `json:"global_row"`
Line uint64 `json:"line,omitempty"`
RowGroup *uint64 `json:"row_group,omitempty"`
RowInGroup uint64 `json:"row_in_group,omitempty"`
PositionBasis string `json:"position_basis,omitempty"`
}
type ParquetGroup ¶
type Result ¶
type Result struct {
Buckets []Bucket
Issues []Issue
Cleanup func()
// contains filtered or unexported fields
}
Result owns evaluation storage independently of its Program and Batch. Call Release after its final consumer, including on unsuccessful writes.
type RowMaterialization ¶
type RuleCoverage ¶
type State ¶
type State uint8
State is the ingestion state of one cell.
func (State) MarshalText ¶
MarshalText encodes s with its report spelling and rejects unknown states.
func (*State) UnmarshalText ¶
UnmarshalText decodes the report spelling written by MarshalText.
type StatisticsPlan ¶
type StatisticsPlan struct {
Groups []GroupEvidence
// contains filtered or unexported fields
}
StatisticsPlan owns its immutable decisions and their managed reservation. Retain gives a consumer a distinct release handle sharing the same storage. Dataset.ApplyStatisticsPlan retains its own handle; callers still Release.
func NewStatisticsPlan ¶
func NewStatisticsPlan(groups []GroupEvidence, cleanup func()) *StatisticsPlan
func (*StatisticsPlan) Release ¶
func (p *StatisticsPlan) Release()
func (*StatisticsPlan) Retain ¶
func (p *StatisticsPlan) Retain() *StatisticsPlan
type Summary ¶
type Summary struct {
ReportVersion int `json:"report_version"`
RunID string `json:"run_id"`
Status string `json:"status"`
Validation string `json:"validation"`
Scope string `json:"scope"`
OutputMode string `json:"output_mode"`
Verification string `json:"verification"`
TrustPolicy string `json:"trust_policy"`
IngestionVerification string `json:"ingestion_verification"`
ProvenancePositionBasis string `json:"provenance_position_basis"`
Coverage Coverage `json:"coverage"`
RuleCoverage map[string]RuleCoverage `json:"rule_coverage"`
RowOutput map[string]RowMaterialization `json:"row_output"`
Total uint64 `json:"total"`
Passed uint64 `json:"pass"`
Warned uint64 `json:"warn"`
Errored uint64 `json:"error"`
RowsScanned uint64 `json:"rows_scanned"`
RuleCounts map[string]uint64 `json:"rule_counts"`
IngestCounts map[string]uint64 `json:"ingest_counts"`
Unevaluable map[string]uint64 `json:"unevaluable"`
NotApplicable map[string]uint64 `json:"not_applicable"`
Stats map[string]any `json:"stats"`
DatasetResults []DatasetResult `json:"dataset_results"`
DatasetIssues []Issue `json:"dataset_issues"`
SchemaIssues []Issue `json:"schema_issues"`
DurationSeconds float64 `json:"duration_seconds"`
Passes int `json:"passes"`
ManagedPeak int64 `json:"managed_peak_bytes"`
ManifestURI string `json:"manifest_uri,omitempty"`
}
func NewSummary ¶
func NewSummary() *Summary