This is an automated email from the ASF dual-hosted git repository.
csy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/auron.git
The following commit(s) were added to refs/heads/master by this push:
new 6b94710d [AURON #2158] fix: change const to static in batch_size() to
fix OnceCell caching (#2159)
6b94710d is described below
commit 6b94710de594ea42f4fbda0116d2eba19e3524f8
Author: yew1eb <[email protected]>
AuthorDate: Fri Apr 3 17:09:37 2026 +0800
[AURON #2158] fix: change const to static in batch_size() to fix OnceCell
caching (#2159)
Fixes AURON-2158. The const OnceCell was creating a new instance on
every call, causing the cache to never hit.
# Which issue does this PR close?
Closes #2158
# Rationale for this change
# What changes are included in this PR?
# Are there any user-facing changes?
# How was this patch tested?
---
native-engine/datafusion-ext-commons/src/lib.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/native-engine/datafusion-ext-commons/src/lib.rs
b/native-engine/datafusion-ext-commons/src/lib.rs
index 8491c379..f63f1053 100644
--- a/native-engine/datafusion-ext-commons/src/lib.rs
+++ b/native-engine/datafusion-ext-commons/src/lib.rs
@@ -72,7 +72,7 @@ macro_rules! downcast_any {
}
pub fn batch_size() -> usize {
- const CACHED_BATCH_SIZE: OnceCell<usize> = OnceCell::new();
+ static CACHED_BATCH_SIZE: OnceCell<usize> = OnceCell::new();
*CACHED_BATCH_SIZE.get_or_init(|| BATCH_SIZE.value().unwrap_or(10000) as
usize)
}