Documentation ¶
Index ¶
- func GetEntityMaps(requestedFeatureViews []*FeatureViewAndRefs, entities []*model.Entity) (map[string]string, map[string]interface{}, error)
- func GroupFeatureRefs(requestedFeatureViews []*FeatureViewAndRefs, ...) (map[string]*GroupedFeaturesPerEntitySet, error)
- func ParseFeatureReference(featureRef string) (featureViewName, featureName string, e error)
- func ValidateEntityValues(joinKeyValues map[string]*prototypes.RepeatedValue, ...) (int, error)
- func ValidateFeatureRefs(requestedFeatures []*FeatureViewAndRefs, fullFeatureNames bool) error
- type FeatureVector
- func EntitiesToFeatureVectors(entityColumns map[string]*prototypes.RepeatedValue, ...) ([]*FeatureVector, error)
- func KeepOnlyRequestedFeatures(vectors []*FeatureVector, requestedFeatureRefs []string, ...) ([]*FeatureVector, error)
- func TransposeFeatureRowsIntoColumns(featureData2D [][]onlinestore.FeatureData, ...) ([]*FeatureVector, error)
- type FeatureViewAndRefs
- func GetFeatureViewsToUseByFeatureRefs(features []string, featureViews map[string]*model.FeatureView, ...) ([]*FeatureViewAndRefs, []*model.OnDemandFeatureView, error)
- func GetFeatureViewsToUseByService(featureService *model.FeatureService, ...) ([]*FeatureViewAndRefs, []*model.OnDemandFeatureView, error)
- type GroupedFeaturesPerEntitySet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEntityMaps ¶
func GroupFeatureRefs ¶
func GroupFeatureRefs(requestedFeatureViews []*FeatureViewAndRefs, joinKeyValues map[string]*prototypes.RepeatedValue, entityNameToJoinKeyMap map[string]string, fullFeatureNames bool, ) (map[string]*GroupedFeaturesPerEntitySet, error, )
func ParseFeatureReference ¶
func ValidateEntityValues ¶
func ValidateEntityValues(joinKeyValues map[string]*prototypes.RepeatedValue, requestData map[string]*prototypes.RepeatedValue, expectedJoinKeysSet map[string]interface{}) (int, error)
func ValidateFeatureRefs ¶
func ValidateFeatureRefs(requestedFeatures []*FeatureViewAndRefs, fullFeatureNames bool) error
Types ¶
type FeatureVector ¶
type FeatureVector struct { Name string Values arrow.Array Statuses []serving.FieldStatus Timestamps []*timestamppb.Timestamp }
FeatureVector type represent result of retrieving single feature for multiple rows. It can be imagined as a column in output dataframe / table. It contains of feature name, list of values (across all rows), list of statuses and list of timestamp. All these lists have equal length. And this length is also equal to number of entity rows received in request.
func EntitiesToFeatureVectors ¶
func EntitiesToFeatureVectors(entityColumns map[string]*prototypes.RepeatedValue, arrowAllocator memory.Allocator, numRows int) ([]*FeatureVector, error)
func KeepOnlyRequestedFeatures ¶
func KeepOnlyRequestedFeatures( vectors []*FeatureVector, requestedFeatureRefs []string, featureService *model.FeatureService, fullFeatureNames bool) ([]*FeatureVector, error)
func TransposeFeatureRowsIntoColumns ¶
func TransposeFeatureRowsIntoColumns(featureData2D [][]onlinestore.FeatureData, groupRef *GroupedFeaturesPerEntitySet, requestedFeatureViews []*FeatureViewAndRefs, arrowAllocator memory.Allocator, numRows int) ([]*FeatureVector, error)
type FeatureViewAndRefs ¶
type FeatureViewAndRefs struct { View *model.FeatureView FeatureRefs []string }
func GetFeatureViewsToUseByFeatureRefs ¶
func GetFeatureViewsToUseByFeatureRefs( features []string, featureViews map[string]*model.FeatureView, onDemandFeatureViews map[string]*model.OnDemandFeatureView) ([]*FeatureViewAndRefs, []*model.OnDemandFeatureView, error)
Return
(1) requested feature views and features grouped per View (2) requested on demand feature views
existed in the registry
func GetFeatureViewsToUseByService ¶
func GetFeatureViewsToUseByService( featureService *model.FeatureService, featureViews map[string]*model.FeatureView, onDemandFeatureViews map[string]*model.OnDemandFeatureView) ([]*FeatureViewAndRefs, []*model.OnDemandFeatureView, error)
Return
(1) requested feature views and features grouped per View (2) requested on demand feature views
existed in the registry
type GroupedFeaturesPerEntitySet ¶
type GroupedFeaturesPerEntitySet struct { // A list of requested feature references of the form featureViewName:featureName that share this entity set FeatureNames []string FeatureViewNames []string // full feature references as they supposed to appear in response AliasedFeatureNames []string // Entity set as a list of EntityKeys to pass to OnlineRead EntityKeys []*prototypes.EntityKey // Reversed mapping to project result of retrieval from storage to response Indices [][]int }
We group all features from a single request by entities they attached to. Thus, we will be able to call online retrieval per entity and not per each feature View. In this struct we collect all features and views that belongs to a group. We also store here projected entity keys (only ones that needed to retrieve these features) and indexes to map result of retrieval into output response.