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

Method with_default_features

datafusion/core/src/execution/session_state.rs:1165–1208  ·  view source on GitHub ↗

Adds defaults for table_factories, file formats, expr_planners and builtin scalar, aggregate and windows functions. Note overwrites any previously registered items with the same name.

(mut self)

Source from the content-addressed store, hash-verified

1163 ///
1164 /// Note overwrites any previously registered items with the same name.
1165 pub fn with_default_features(mut self) -> Self {
1166 self.table_factories
1167 .get_or_insert_with(HashMap::new)
1168 .extend(SessionStateDefaults::default_table_factories());
1169
1170 self.file_formats
1171 .get_or_insert_with(Vec::new)
1172 .extend(SessionStateDefaults::default_file_formats());
1173
1174 self.expr_planners
1175 .get_or_insert_with(Vec::new)
1176 .extend(SessionStateDefaults::default_expr_planners());
1177
1178 self.scalar_functions
1179 .get_or_insert_with(Vec::new)
1180 .extend(SessionStateDefaults::default_scalar_functions());
1181
1182 self.higher_order_functions
1183 .get_or_insert_with(Vec::new)
1184 .extend(SessionStateDefaults::default_higher_order_functions());
1185
1186 self.aggregate_functions
1187 .get_or_insert_with(Vec::new)
1188 .extend(SessionStateDefaults::default_aggregate_functions());
1189
1190 self.window_functions
1191 .get_or_insert_with(Vec::new)
1192 .extend(SessionStateDefaults::default_window_functions());
1193
1194 self.extension_types
1195 .get_or_insert_with(|| Arc::new(MemoryExtensionTypeRegistry::new_empty()))
1196 .extend(&SessionStateDefaults::default_extension_types())
1197 .expect("MemoryExtensionTypeRegistry is not read-only.");
1198
1199 self.table_functions
1200 .get_or_insert_with(HashMap::new)
1201 .extend(
1202 SessionStateDefaults::default_table_functions()
1203 .into_iter()
1204 .map(|f| (f.name().to_string(), f)),
1205 );
1206
1207 self
1208 }
1209
1210 /// Returns a new [`SessionStateBuilder`] with default features.
1211 ///

Callers 15

table_sampleFunction · 0.80
custom_file_formatFunction · 0.80
roundtrip_custom_tablesFunction · 0.80
make_session_stateFunction · 0.80
query_compress_dataFunction · 0.80
newMethod · 0.80
new_with_config_rtMethod · 0.80

Calls 6

newFunction · 0.85
extendMethod · 0.45
mapMethod · 0.45
into_iterMethod · 0.45
to_stringMethod · 0.45
nameMethod · 0.45