Skip to content

Conversation

@Manisha4
Copy link
Collaborator

@Manisha4 Manisha4 commented Nov 16, 2025

What this PR does / why we need it:

Added Online Read Range functionality for Redis.

The core behavior is:

  • Serialize entity keys using the same Python–compatible serialization.
  • Group requested features by Feature View.
  • Compute ZRANGEBYSCORE bounds from Feast SortKeyFilter rules, supporting equals, inclusive/exclusive ranges, and time.Time values.
  • Pipeline ZRANGE calls per entity key across all feature views, retrieving the list of sort keys in the requested range.
  • For each returned sort key, pipeline batched HMGET operations, fetching the values and timestamp for each row.
  • Decode protobuf feature values and timestamps into RangeFeatureData, preserving order, status, and timestamp.
  • Return a matrix of shape [#entity_keys][#requested_features], each containing time-ordered slices of values, statuses, and event timestamps.
  • Return the results

Which issue(s) this PR fixes:

Misc

Comment on lines 370 to 373
end := start + PIPELINE_BATCH_SIZE
if end > len(members) {
end = len(members)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Condense to one line

Suggested change
end := start + PIPELINE_BATCH_SIZE
if end > len(members) {
end = len(members)
}
end := max(start + PIPELINE_BATCH_SIZE, len(members))

switch skf.Order.Order {
case core.SortOrder_DESC:
return !effective
case core.SortOrder_ASC, core.SortOrder_INVALID:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let SortOrder_INVALID be handled by the default. It shouldn't actually come up given our validations.

}

// DecodeFeatureValue Helper function to decode feature value protobuf
func DecodeFeatureValue(raw interface{}, fv, fn, member string) (interface{}, serving.FieldStatus) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is a common function for redis and valkey, it should be moved to the utils file.

Copy link
Collaborator

@piket piket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Manisha4 Manisha4 merged commit 7acc915 into rq-redis-dev-branch Nov 18, 2025
53 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants