robin_sparkless_expr/
udf_context.rs1use std::cell::RefCell;
4use std::sync::Arc;
5
6use crate::udf_registry::UdfRegistry;
7
8thread_local! {
9 static THREAD_UDF_CONTEXT: RefCell<Option<(Arc<UdfRegistry>, bool)>> = const { RefCell::new(None) };
10}
11
12pub fn set_thread_udf_context(registry: Arc<UdfRegistry>, case_sensitive: bool) {
14 THREAD_UDF_CONTEXT.with(|cell| *cell.borrow_mut() = Some((registry, case_sensitive)));
15}
16
17pub fn get_thread_udf_context() -> Option<(Arc<UdfRegistry>, bool)> {
19 THREAD_UDF_CONTEXT.with(|cell| cell.borrow().clone())
20}