|
5 | 5 | "errors" |
6 | 6 |
|
7 | 7 | "github.com/apache/arrow/go/v8/arrow/memory" |
| 8 | + |
8 | 9 | "github.com/feast-dev/feast/go/internal/feast/model" |
9 | 10 | "github.com/feast-dev/feast/go/internal/feast/onlineserving" |
10 | 11 | "github.com/feast-dev/feast/go/internal/feast/onlinestore" |
@@ -287,3 +288,32 @@ func (fs *FeatureStore) readFromOnlineStore(ctx context.Context, entityRows []*p |
287 | 288 | } |
288 | 289 | return fs.onlineStore.OnlineRead(ctx, entityRowsValue, requestedFeatureViewNames, requestedFeatureNames) |
289 | 290 | } |
| 291 | + |
| 292 | +func (fs *FeatureStore) GetFcosMap() (map[string]*model.Entity, map[string]*model.FeatureView, map[string]*model.OnDemandFeatureView, error) { |
| 293 | + odfvs, err := fs.ListOnDemandFeatureViews() |
| 294 | + if err != nil { |
| 295 | + return nil, nil, nil, err |
| 296 | + } |
| 297 | + fvs, err := fs.ListFeatureViews() |
| 298 | + if err != nil { |
| 299 | + return nil, nil, nil, err |
| 300 | + } |
| 301 | + entities, err := fs.ListEntities(true) |
| 302 | + if err != nil { |
| 303 | + return nil, nil, nil, err |
| 304 | + } |
| 305 | + |
| 306 | + entityMap := make(map[string]*model.Entity) |
| 307 | + for _, entity := range entities { |
| 308 | + entityMap[entity.Name] = entity |
| 309 | + } |
| 310 | + fvMap := make(map[string]*model.FeatureView) |
| 311 | + for _, fv := range fvs { |
| 312 | + fvMap[fv.Base.Name] = fv |
| 313 | + } |
| 314 | + odfvMap := make(map[string]*model.OnDemandFeatureView) |
| 315 | + for _, odfv := range odfvs { |
| 316 | + odfvMap[odfv.Base.Name] = odfv |
| 317 | + } |
| 318 | + return entityMap, fvMap, odfvMap, nil |
| 319 | +} |
0 commit comments