MCPcopy Create free account
hub / github.com/apache/datafusion / with_spark_features

Method with_spark_features

datafusion/spark/src/session_state.rs:57–85  ·  view source on GitHub ↗
(mut self)

Source from the content-addressed store, hash-verified

55
56impl SessionStateBuilderSpark for SessionStateBuilder {
57 fn with_spark_features(mut self) -> Self {
58 self.expr_planners()
59 .get_or_insert_with(Vec::new)
60 // planners are evaluated in order of insertion. Push Apache Spark function planner to the front
61 // to take precedence over others
62 .insert(0, Arc::new(SparkFunctionPlanner));
63
64 self.scalar_functions()
65 .get_or_insert_with(Vec::new)
66 .extend(all_default_scalar_functions());
67
68 self.aggregate_functions()
69 .get_or_insert_with(Vec::new)
70 .extend(all_default_aggregate_functions());
71
72 self.window_functions()
73 .get_or_insert_with(Vec::new)
74 .extend(all_default_window_functions());
75
76 self.table_functions()
77 .get_or_insert_with(HashMap::new)
78 .extend(
79 all_default_table_functions()
80 .into_iter()
81 .map(|f| (f.name().to_string(), f)),
82 );
83
84 self
85 }
86}
87
88#[cfg(test)]

Calls 15

newFunction · 0.85
table_functionsMethod · 0.80
insertMethod · 0.45
expr_plannersMethod · 0.45
extendMethod · 0.45
scalar_functionsMethod · 0.45
aggregate_functionsMethod · 0.45
window_functionsMethod · 0.45

Tested by 2

try_new_for_test_fileMethod · 0.64