Skip to main content

proof_of_sql_planner/
config.rs

1use datafusion::config::{ConfigOptions, SqlParserOptions};
2
3/// Since all of our table identifiers/column identifiers are stored and communicated in all-caps,
4/// we need to disable this datafusion setting that will coerce identifiers to lowercase.
5#[must_use]
6pub fn datafusion_config_no_normalization() -> ConfigOptions {
7    let mut config = ConfigOptions::new();
8    config.sql_parser = SqlParserOptions {
9        enable_ident_normalization: false,
10        ..Default::default()
11    };
12    config
13}
14
15#[cfg(test)]
16mod tests {
17    use crate::datafusion_config_no_normalization;
18
19    #[test]
20    fn get_config() {
21        assert!(
22            !datafusion_config_no_normalization()
23                .sql_parser
24                .enable_ident_normalization
25        );
26    }
27}