@@ -374,16 +374,32 @@ def execute(self, context: ExecutionContext) -> ArrowTableValue:
374374 for entity in self .feature_view .entity_columns
375375 }
376376
377- rows_to_write = _convert_arrow_to_proto (
378- input_table , self .feature_view , join_key_to_value_type
379- )
380-
381- online_store .online_write_batch (
382- config = context .repo_config ,
383- table = self .feature_view ,
384- data = rows_to_write ,
385- progress = lambda x : None ,
377+ batch_size = (
378+ context .repo_config .materialization_config .online_write_batch_size
386379 )
380+ if batch_size is None :
381+ # Default: write all rows in a single batch (backward compatible)
382+ rows_to_write = _convert_arrow_to_proto (
383+ input_table , self .feature_view , join_key_to_value_type
384+ )
385+ online_store .online_write_batch (
386+ config = context .repo_config ,
387+ table = self .feature_view ,
388+ data = rows_to_write ,
389+ progress = lambda x : None ,
390+ )
391+ else :
392+ # Batched writes when batch_size is configured
393+ for batch in input_table .to_batches (max_chunksize = batch_size ):
394+ rows_to_write = _convert_arrow_to_proto (
395+ batch , self .feature_view , join_key_to_value_type
396+ )
397+ online_store .online_write_batch (
398+ config = context .repo_config ,
399+ table = self .feature_view ,
400+ data = rows_to_write ,
401+ progress = lambda x : None ,
402+ )
387403
388404 if self .feature_view .offline :
389405 offline_store = context .offline_store
0 commit comments