Documentation
¶
Overview ¶
Package transformation provides transformation model configuration and validation
Index ¶
- Constants
- Variables
- func ValidateScheduleFormat(schedule string) error
- type BackfillConfig
- type Config
- func (c *Config) GetBackfillInterval() uint64
- func (c *Config) GetForwardInterval() uint64
- func (c *Config) GetForwardSchedule() string
- func (c *Config) GetID() string
- func (c *Config) GetMaxLimit() uint64
- func (c *Config) GetMinLimit() uint64
- func (c *Config) GetMinPartialInterval() uint64
- func (c *Config) HasLimits() bool
- func (c *Config) IsBackfillEnabled() bool
- func (c *Config) IsPartialIntervalsAllowed() bool
- func (c *Config) Validate() error
- type Exec
- type ExecParser
- type ForwardFillConfig
- type LimitsConfig
- type SQL
- type SQLParser
Constants ¶
const TransformationTypeExec = "exec"
TransformationTypeExec identifies exec transformation models
const TransformationTypeSQL = "sql"
TransformationTypeSQL identifies SQL transformation models
Variables ¶
var ( // ErrDatabaseRequired is returned when database is not specified ErrDatabaseRequired = errors.New("database is required") // ErrTableRequired is returned when table is not specified ErrTableRequired = errors.New("table is required") // ErrNoProcessingConfig is returned when neither forwardfill nor backfill is specified ErrNoProcessingConfig = errors.New("at least one of forwardfill or backfill must be configured") // ErrIntervalRequired is returned when interval is not specified ErrIntervalRequired = errors.New("interval is required") // ErrScheduleRequired is returned when schedule is not specified ErrScheduleRequired = errors.New("schedule is required") // ErrIncompleteConfig is returned when config has interval but no schedule or vice versa ErrIncompleteConfig = errors.New("both interval and schedule must be specified") // ErrDependenciesRequired is returned when dependencies are not specified ErrDependenciesRequired = errors.New("dependencies is required") // ErrInvalidLimits is returned when min limit is greater than max limit ErrInvalidLimits = errors.New("min limit cannot be greater than max limit") // ErrInvalidPartialInterval is returned when min_partial_interval exceeds interval ErrInvalidPartialInterval = errors.New("min_partial_interval cannot exceed interval") // ErrPartialIntervalRequiresFlag is returned when min_partial_interval is set without allow_partial_intervals ErrPartialIntervalRequiresFlag = errors.New("min_partial_interval requires allow_partial_intervals to be true") )
var ( // ErrInvalidFrontmatter is returned when frontmatter is invalid ErrInvalidFrontmatter = errors.New("invalid frontmatter") // ErrSQLContentRequired is returned when SQL content is not specified ErrSQLContentRequired = errors.New("sql content is required") )
var ( // ErrExecRequired is returned when exec is not specified ErrExecRequired = errors.New("exec is required") )
Functions ¶
func ValidateScheduleFormat ¶
ValidateScheduleFormat validates a cron schedule expression
Types ¶
type BackfillConfig ¶
BackfillConfig defines backfill configuration for transformations
func (*BackfillConfig) Validate ¶
func (c *BackfillConfig) Validate() error
Validate checks if the backfill configuration is valid
type Config ¶
type Config struct {
Database string `yaml:"database"`
Table string `yaml:"table"`
Limits *LimitsConfig `yaml:"limits,omitempty"`
ForwardFill *ForwardFillConfig `yaml:"forwardfill"`
Backfill *BackfillConfig `yaml:"backfill,omitempty"`
Dependencies []string `yaml:"dependencies"`
Tags []string `yaml:"tags"`
}
Config defines the configuration for transformation models
func (*Config) GetBackfillInterval ¶ added in v0.0.2
GetBackfillInterval returns the interval for backfill operations
func (*Config) GetForwardInterval ¶ added in v0.0.2
GetForwardInterval returns the interval for forward fill operations
func (*Config) GetForwardSchedule ¶ added in v0.0.2
GetForwardSchedule returns the schedule for forward fill operations
func (*Config) GetMaxLimit ¶ added in v0.0.2
GetMaxLimit returns the maximum position limit (0 means no limit)
func (*Config) GetMinLimit ¶ added in v0.0.2
GetMinLimit returns the minimum position limit
func (*Config) GetMinPartialInterval ¶ added in v0.0.6
GetMinPartialInterval returns the minimum partial interval for forward fill
func (*Config) IsBackfillEnabled ¶ added in v0.0.2
IsBackfillEnabled returns true if backfill is configured
func (*Config) IsPartialIntervalsAllowed ¶ added in v0.0.6
IsPartialIntervalsAllowed returns true if partial intervals are allowed for forward fill
type Exec ¶
Exec represents a transformation exec model with YAML config
func NewTransformationExec ¶
NewTransformationExec creates a new transformation exec model from content
type ForwardFillConfig ¶ added in v0.0.2
type ForwardFillConfig struct {
Interval uint64 `yaml:"interval"`
Schedule string `yaml:"schedule"`
AllowPartialIntervals bool `yaml:"allow_partial_intervals,omitempty"` // Allow sub-interval processing when dependencies partially available
MinPartialInterval uint64 `yaml:"min_partial_interval,omitempty"` // Minimum interval size for partial processing (0 = no minimum)
}
ForwardFillConfig defines forward fill configuration for transformations
func (*ForwardFillConfig) Validate ¶ added in v0.0.2
func (c *ForwardFillConfig) Validate() error
Validate checks if the forward fill configuration is valid
type LimitsConfig ¶ added in v0.0.2
LimitsConfig defines position limits for transformations
func (*LimitsConfig) Validate ¶ added in v0.0.2
func (c *LimitsConfig) Validate() error
Validate checks if the limits configuration is valid