Documentation
¶
Index ¶
- func Days(n int64) time.Duration
- func GetDefault[M ~map[K]V, K comparable, V any](m M, k K, def V) V
- func Hours(n int64) time.Duration
- func MaybeStr(s string) *string
- func Minutes(n int64) time.Duration
- func Primitive(name string) *graphv1.FeatureRichTypeInfo
- func Seconds(n int64) time.Duration
- func Weeks(n int64) time.Duration
- type Definitions
- type FeatureBuilder
- type FeatureSet
- type HasManyFeatureBuilder
- type MaterializationOptions
- type ScalarFeatureBuilder
- type WindowedFeatureBuilder
- func (w *WindowedFeatureBuilder) ToProtos(fieldName string, namespace string) ([]*graphv1.FeatureType, error)
- func (w *WindowedFeatureBuilder) WithBucketDuration(duration time.Duration) *WindowedFeatureBuilder
- func (w *WindowedFeatureBuilder) WithDefault(expression expr.Expr) *WindowedFeatureBuilder
- func (w *WindowedFeatureBuilder) WithDurationForWindows(duration time.Duration, windows ...time.Duration) *WindowedFeatureBuilder
- func (w *WindowedFeatureBuilder) WithExpr(expression expr.Expr) *WindowedFeatureBuilder
- func (w *WindowedFeatureBuilder) WithMaterialization(mo MaterializationOptions) *WindowedFeatureBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefault ¶
func GetDefault[M ~map[K]V, K comparable, V any](m M, k K, def V) V
func Primitive ¶
func Primitive(name string) *graphv1.FeatureRichTypeInfo
Types ¶
type Definitions ¶
type Definitions struct {
FeatureSets []*FeatureSet
}
func (Definitions) WithFeatureSets ¶
func (d Definitions) WithFeatureSets(fs ...FeatureSet) Definitions
type FeatureBuilder ¶
type FeatureBuilder interface {
ToProtos(string, string) ([]*graphv1.FeatureType, error)
}
func DataFrame ¶
func DataFrame(foreignName string) FeatureBuilder
type FeatureSet ¶
type FeatureSet struct {
Name string
Features []*graphv1.FeatureType
IsSingleton bool
Tags []string
Owner string
Doc string
EtlOfflineToOnline bool
// contains filtered or unexported fields
}
func (*FeatureSet) ToProto ¶
func (fs *FeatureSet) ToProto() *graphv1.FeatureSet
func (FeatureSet) With ¶
func (fs FeatureSet) With(name string, ofType FeatureBuilder) FeatureSet
func (FeatureSet) WithForeignKey ¶
func (fs FeatureSet) WithForeignKey(name string, relation string) FeatureSet
func (FeatureSet) WithPrimary ¶
func (fs FeatureSet) WithPrimary(name string, ofType FeatureBuilder) FeatureSet
type HasManyFeatureBuilder ¶
type HasManyFeatureBuilder struct {
ForeignNamespace string
}
func (*HasManyFeatureBuilder) ToProtos ¶
func (hm *HasManyFeatureBuilder) ToProtos(fieldName string, namespace string) ([]*graphv1.FeatureType, error)
type MaterializationOptions ¶
type MaterializationOptions struct {
// map window -> bucket duration
// NOTE: OPPOSITE ORDER AS chalkpy if construction is being done via struct
BucketDurations map[time.Duration]time.Duration
DefaultBucketDuration time.Duration
// The period for which to use the continuous resolver, instead
// of relying upon the last backfill. If not provided, and a continuous
// resolver is provided, this will be set to backfill_lookback_duration.
ContinuousBufferDuration time.Duration
// A crontab or duration string to specify the schedule for back filling the
// materialized aggregate.
BackfillSchedule string
// The lower bound of the first bucket. All buckets are aligned to this time.
BucketStart time.Time
// technically not part of materialization kwarg, but still useful to expose (for now)
GroupBy []*graphv1.FeatureReference
// The 'k' arg of approx_top_k.
ApproxTopKArgK int64
// The resolver to use for back-filling the materialized aggregate.
// If not provided, the data will be back filled using the resolver
// that would run for an offline query.
BackfillResolver string
// The amount of time before the start of the previous backfill
// to consider when running the backfill resolver. Set this parameter
// to the be equal to the latest arriving data in the backfill window.
BackfillLookbackDuration time.Duration
// The time at which to start back filling the materialized aggregate.
// If not provided, the backfill consider the earliest available data returned
// by the `backfill_resolver`.
BackfillStartTime time.Time
// The resolver to use for continuous updates to the materialized aggregate.
// If not provided, the data will be updated using the resolver that would run
// for an online query.
ContinuousResolver string
}
type ScalarFeatureBuilder ¶
type ScalarFeatureBuilder struct {
// contains filtered or unexported fields
}
func Datetime ¶
func Datetime() *ScalarFeatureBuilder
func Float ¶
func Float() *ScalarFeatureBuilder
func Int ¶
func Int() *ScalarFeatureBuilder
func String ¶
func String() *ScalarFeatureBuilder
func (ScalarFeatureBuilder) Expr ¶
func (ofType ScalarFeatureBuilder) Expr(expression expr.Expr) FeatureBuilder
func (ScalarFeatureBuilder) ToProto ¶
func (f ScalarFeatureBuilder) ToProto(fieldName string, namespace string) *graphv1.FeatureType
func (ScalarFeatureBuilder) ToProtos ¶
func (f ScalarFeatureBuilder) ToProtos(fieldName string, namespace string) ([]*graphv1.FeatureType, error)
type WindowedFeatureBuilder ¶
type WindowedFeatureBuilder struct {
Default expr.Expr
Expression expr.Expr
Materialization MaterializationOptions
// contains filtered or unexported fields
}
func Windowed ¶
func Windowed(ofType FeatureBuilder, windows ...time.Duration) *WindowedFeatureBuilder
func (*WindowedFeatureBuilder) ToProtos ¶
func (w *WindowedFeatureBuilder) ToProtos(fieldName string, namespace string) ([]*graphv1.FeatureType, error)
func (*WindowedFeatureBuilder) WithBucketDuration ¶
func (w *WindowedFeatureBuilder) WithBucketDuration(duration time.Duration) *WindowedFeatureBuilder
func (*WindowedFeatureBuilder) WithDefault ¶
func (w *WindowedFeatureBuilder) WithDefault(expression expr.Expr) *WindowedFeatureBuilder
func (*WindowedFeatureBuilder) WithDurationForWindows ¶
func (w *WindowedFeatureBuilder) WithDurationForWindows(duration time.Duration, windows ...time.Duration) *WindowedFeatureBuilder
func (*WindowedFeatureBuilder) WithExpr ¶
func (w *WindowedFeatureBuilder) WithExpr(expression expr.Expr) *WindowedFeatureBuilder
func (*WindowedFeatureBuilder) WithMaterialization ¶
func (w *WindowedFeatureBuilder) WithMaterialization(mo MaterializationOptions) *WindowedFeatureBuilder
NOTE: this will override all previous materialization settings (WithBucketDuration,WithDurationForWindows)
Click to show internal directories.
Click to hide internal directories.