feast icon indicating copy to clipboard operation
feast copied to clipboard

FeatureService that have one featureView but duplicated columns different meaning.

Open larcane97 opened this issue 2 years ago • 1 comments

I encountered feast.errors.FeatureNameCollisionError: Duplicate features named error in the situation retrieving feature by featureService, but the featureService have two columns in one featureView but different meaning.

below is my featureService definition

taxi_h3_resolution7_fs = FeatureService(
    name=f"{name}_fs",
    features=[
        taxi_h3_resolution7_fv
        .with_name("taxi_origin_h3_resolution_fv")
        .with_join_key_map({"h3_resolution7": "origin_h3_res7"}),
        taxi_h3_resolution7_fv
        .with_name("taxi_destination_h3_resolution_fv")
        .with_join_key_map(
            {"h3_resolution7": "destination_h3_res7"}
        ),
    ],
)

I wanna get feature from taxi_h3_resolution7_fv, but from that origination feature and destination feature both are needed. at that case, when I try to retrieve feature, I faced above error.

service = store.get_feature_service("taxi_h3_resolution7_fs")
features = store.get_online_features(features=service, entity_rows=[
    {"origin_h3_res7": "8730eec8effffff", "destination_h3_res7": "8730eec8effffff", }])

is there a solution solve that problem? or now im doing wrong way to retrieve feature?

larcane97 avatar Jan 27 '24 09:01 larcane97

I found that in python sdk I can solve this by setting full_feature_names=True.

but in java sdk it's not applied. request.setFullFeatureNames(true)

larcane97 avatar Jan 28 '24 18:01 larcane97