From 7878b601bb380723d4211ecef5fbcc81c6112f5c Mon Sep 17 00:00:00 2001 From: Jinghan Ying Date: Fri, 12 Nov 2021 16:31:00 +0800 Subject: [PATCH] fix(featctl/cmd): fix command join_historical_feature --- featctl/cmd/join_historical_feature_helper.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/featctl/cmd/join_historical_feature_helper.go b/featctl/cmd/join_historical_feature_helper.go index 31ee7e98e..36c528b36 100644 --- a/featctl/cmd/join_historical_feature_helper.go +++ b/featctl/cmd/join_historical_feature_helper.go @@ -9,6 +9,7 @@ import ( "strconv" "github.com/olekukonko/tablewriter" + "github.com/oom-ai/oomstore/internal/database/metadatav2" "github.com/oom-ai/oomstore/pkg/oomstore" "github.com/oom-ai/oomstore/pkg/oomstore/types" "github.com/spf13/cast" @@ -25,11 +26,15 @@ func joinHistoricalFeatures(ctx context.Context, store *oomstore.OomStore, opt J return err } - // TODO: convert feature names into feature IDs - var featureIDs []int16 + features := store.ListFeature(ctx, metadatav2.ListFeatureOpt{ + FeatureNames: &opt.FeatureNames, + }) + if err != nil { + return nil + } joinResult, err := store.GetHistoricalFeatureValues(ctx, types.GetHistoricalFeatureValuesOpt{ - FeatureIDs: featureIDs, + FeatureIDs: features.Ids(), EntityRows: entityRows, }) if err != nil {