Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-plan/src/constants.rs
6939 views
1
use std::sync::OnceLock;
2
3
use polars_utils::pl_str::PlSmallStr;
4
5
pub static CSE_REPLACED: &str = "__POLARS_CSER_";
6
pub static POLARS_TMP_PREFIX: &str = "_POLARS_";
7
pub static POLARS_PLACEHOLDER: &str = "_POLARS_<>";
8
pub const LEN: &str = "len";
9
const LITERAL_NAME: &str = "literal";
10
11
// Cache the often used LITERAL and LEN constants
12
static LITERAL_NAME_INIT: OnceLock<PlSmallStr> = OnceLock::new();
13
static LEN_INIT: OnceLock<PlSmallStr> = OnceLock::new();
14
15
pub fn get_literal_name() -> &'static PlSmallStr {
16
LITERAL_NAME_INIT.get_or_init(|| PlSmallStr::from_static(LITERAL_NAME))
17
}
18
pub(crate) fn get_len_name() -> PlSmallStr {
19
LEN_INIT
20
.get_or_init(|| PlSmallStr::from_static(LEN))
21
.clone()
22
}
23
24