@@ -28,6 +28,8 @@ use serde::{Deserialize, Serialize};
2828#[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
2929pub struct BenchmarkRuntimeConfig {
3030 pub target_partitions : usize ,
31+ #[ serde( default = "default_batch_size" ) ]
32+ pub batch_size : usize ,
3133 #[ serde( default ) ]
3234 pub parquet_pushdown_filters : bool ,
3335 pub memory_limit_bytes : Option < usize > ,
@@ -41,6 +43,7 @@ impl Default for BenchmarkRuntimeConfig {
4143 target_partitions : std:: thread:: available_parallelism ( )
4244 . map ( usize:: from)
4345 . unwrap_or ( 1 ) ,
46+ batch_size : default_batch_size ( ) ,
4447 parquet_pushdown_filters : false ,
4548 memory_limit_bytes : None ,
4649 spill_dir : None ,
@@ -49,6 +52,10 @@ impl Default for BenchmarkRuntimeConfig {
4952 }
5053}
5154
55+ fn default_batch_size ( ) -> usize {
56+ 8192
57+ }
58+
5259pub fn build_sql_context ( config : & BenchmarkRuntimeConfig ) -> DataFusionResult < SQLContext > {
5360 let mut runtime = RuntimeEnvBuilder :: new ( ) ;
5461 if let Some ( memory_limit) = config. memory_limit_bytes {
@@ -66,7 +73,8 @@ pub fn build_sql_context(config: &BenchmarkRuntimeConfig) -> DataFusionResult<SQ
6673 let mut session_config = current_state
6774 . config ( )
6875 . clone ( )
69- . with_target_partitions ( config. target_partitions . max ( 1 ) ) ;
76+ . with_target_partitions ( config. target_partitions . max ( 1 ) )
77+ . with_batch_size ( config. batch_size . max ( 1 ) ) ;
7078 session_config
7179 . options_mut ( )
7280 . execution
@@ -100,6 +108,13 @@ pub async fn open_catalog_session(
100108 let mut sql = build_sql_context ( runtime_config) ?;
101109 sql. register_catalog_with_default_db ( "paimon" , catalog. clone ( ) , Some ( database) )
102110 . await ?;
111+ // Keep decoder batch boundaries identical for Parquet and Paimon. Paimon
112+ // retains Java's table default, so use its supported session override.
113+ sql. sql ( & format ! (
114+ "SET 'paimon.read.batch-size' = '{}'" ,
115+ runtime_config. batch_size
116+ ) )
117+ . await ?;
103118 Ok ( CatalogSession {
104119 sql,
105120 catalog,
0 commit comments