Visitar URL original
feat: Make online_write_batch_size configurable in MaterializationConfig by cutoutsy · Pull Request #6268 · feast-dev/feast · GitHub
Skip to content
Merged
Show file tree
Hide file tree
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
Next Next commit
feat: make online_write_batch_size configurable in MaterializationConfig
Signed-off-by: cutoutsy <cutoutsy@gmail.com>
  • Loading branch information
cutoutsy authored and ntkathole committed Apr 14, 2026
commit 73193607b0f181d5ceb0320c41fd4a26c44499b3
34 changes: 25 additions & 9 deletions sdk/python/feast/infra/compute_engines/local/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,16 +374,32 @@ def execute(self, context: ExecutionContext) -> ArrowTableValue:
for entity in self.feature_view.entity_columns
}

rows_to_write = _convert_arrow_to_proto(
input_table, self.feature_view, join_key_to_value_type
)

online_store.online_write_batch(
config=context.repo_config,
table=self.feature_view,
data=rows_to_write,
progress=lambda x: None,
batch_size = (
context.repo_config.materialization_config.online_write_batch_size
)
if batch_size is None:
# Default: write all rows in a single batch (backward compatible)
rows_to_write = _convert_arrow_to_proto(
input_table, self.feature_view, join_key_to_value_type
)
online_store.online_write_batch(
config=context.repo_config,
table=self.feature_view,
data=rows_to_write,
progress=lambda x: None,
)
Comment thread
cutoutsy marked this conversation as resolved.
else:
# Batched writes when batch_size is configured
for batch in input_table.to_batches(max_chunksize=batch_size):
rows_to_write = _convert_arrow_to_proto(
batch, self.feature_view, join_key_to_value_type
)
online_store.online_write_batch(
config=context.repo_config,
table=self.feature_view,
data=rows_to_write,
progress=lambda x: None,
)
Comment thread
cutoutsy marked this conversation as resolved.
Outdated

if self.feature_view.offline:
offline_store = context.offline_store
Expand Down
5 changes: 5 additions & 0 deletions sdk/python/feast/repo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ class MaterializationConfig(BaseModel):
""" bool: If true, feature retrieval jobs will only pull the latest feature values for each entity.
If false, feature retrieval jobs will pull all feature values within the specified time range. """

online_write_batch_size: Optional[int] = Field(default=None, gt=0)
""" int: Number of rows to write to online store per batch during materialization.
If None (default), all rows are written in a single batch for backward compatibility.
Set to a positive integer (e.g., 10000) to enable batched writes. """
Comment thread
cutoutsy marked this conversation as resolved.
Outdated


class OpenLineageConfig(FeastBaseModel):
"""Configuration for OpenLineage integration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
LocalOutputNode,
LocalTransformationNode,
)
from feast.repo_config import MaterializationConfig

backend = PandasBackend()
now = pd.Timestamp.utcnow()
Expand All @@ -37,9 +38,11 @@

def create_context(node_outputs):
# Setup execution context
repo_config = MagicMock()
repo_config.materialization_config = MaterializationConfig()
return ExecutionContext(
project="test_proj",
repo_config=MagicMock(),
repo_config=repo_config,
offline_store=MagicMock(),
online_store=MagicMock(),
entity_defs=MagicMock(),
Expand Down