Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Online Serving unable to retrieve feature data after Feature Set update. #908

Merged
merged 16 commits into from
Aug 1, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clarify docs about Feature Row v1 encoding and Feature Row v2 encoding
mrzzy committed Aug 1, 2020
commit d2dcfb2bb3ebe34fa4f3402d912057be347a0c83
Original file line number Diff line number Diff line change
@@ -41,10 +41,10 @@ public FeatureRowDecoder(String featureSetRef, FeatureSetSpec spec) {
}

/**
* Check if encoded feature row v1 is encoded. A Feature Row v1 is considered encoded if both it'
* feature set reference and fields names are not set. The no. of fields in the feature row should
* also match up with the number of fields in the Feature Set spec. NOTE: This method is
* deprecated and will be removed in Feast v0.7.
* Check if encoded feature row v1 is encoded. The Feature Row v1 encoding defines that a Feature
* Row is is considered encoded if both it's feature set reference and fields names are not set .
* The no. of fields in the feature row should also match up with the number of fields in the
* Feature Set spec. NOTE: This method is deprecated and will be removed in Feast v0.7.
*
* @param featureRow Feature row
* @return boolean
@@ -57,8 +57,8 @@ private boolean isEncodedV1(FeatureRow featureRow) {
}

/**
* Check if encoded feature row v2 is encoded. A Feature Row v2 is considered encoded if it's both
* it feature set reference and fields names are set.
* Check if encoded feature row v2 is encoded. The Feature Row v2 encoding defines that a Feature
* Row is f is considered encoded if it's both it feature set reference and fields names are set.
*
* @param featureRow Feature row
* @return boolean
@@ -68,8 +68,8 @@ private boolean isEncodedV2(FeatureRow featureRow) {
}

/**
* Decode feature row encoded by {@link RedisCustomIO}. NOTE: support for decoding feature row v1
* will be dropped in Feast 0.7
* Decode feature row encoded by {@link RedisCustomIO}. NOTE: support for decoding Feature Row v1
* encoding will be dropped in Feast 0.7
*
* @throws IllegalArgumentException if unable to the decode the given feature row
* @param encodedFeatureRow Feature row
@@ -106,7 +106,7 @@ public FeatureRow decode(FeatureRow encodedFeatureRow) {
.build();

} else if (isEncodedV2(encodedFeatureRow)) {
// Encoded Feature Row v2 uses a hashed name as the field name and does not have feature set
// Feature Row v2 encoding uses a hashed name as the field name and does not have feature set
// reference set.
// Decoding reverts the field name to a unhashed string and set feature set reference.
Map<String, Value> nameHashValueMap =
Original file line number Diff line number Diff line change
@@ -207,7 +207,7 @@ private byte[] getKey(FeatureRow featureRow, FeatureSetSpec spec) {
}

/**
* Encode the Feature Row as bytes to store in Redis in encoded Feature Row v2 format. To
* Encode the Feature Row as bytes to store in Redis in encoded Feature Row v2 encoding. To
* reduce storage space consumption in redis, feature rows are "encoded" by hashing the fields
* names and not unsetting the feature set reference. {@link FeatureRowDecoder} is
* rensponsible for reversing this "encoding" step.
Original file line number Diff line number Diff line change
@@ -162,7 +162,7 @@ public void shouldDecodeValidFeatureRowV2AndIgnoreExtraFields() {
assertEquals(expectedFeatureRow, decoder.decode(encodedFeatureRow));
}

// TODO: remove this test in Feast 0.7 when support for Feature Row v1 is removed
// TODO: remove this test in Feast 0.7 when support for Feature Row v1 encoding is removed
@Test
public void shouldDecodeValidEncodedFeatureRowV1() {
FeatureRowDecoder decoder = new FeatureRowDecoder("feature_set_ref", spec);