andygrove commented on code in PR #2771:
URL: https://github.com/apache/arrow-datafusion/pull/2771#discussion_r906044337


##########
datafusion/core/src/execution/context.rs:
##########
@@ -1055,12 +1050,16 @@ impl SessionConfig {
         self.set(key, ScalarValue::Boolean(Some(value)))
     }
 
+    /// Set a u32 configuration option
+    pub fn set_u32(self, key: &str, value: u32) -> Self {
+        self.set(key, ScalarValue::UInt32(Some(value)))
+    }
+
     /// Customize batch size
-    pub fn with_batch_size(mut self, n: usize) -> Self {
+    pub fn with_batch_size(self, n: usize) -> Self {
         // batch size must be greater than zero
         assert!(n > 0);
-        self.batch_size = n;
-        self
+        self.set_u32(OPT_BATCH_SIZE, n as u32)

Review Comment:
   I changed to `u64` but it still requires casting back and forth to `usize`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to