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

Method create

datafusion/datasource-json/src/file_format.rs:87–109  ·  view source on GitHub ↗
(
        &self,
        state: &dyn Session,
        format_options: &HashMap<String, String>,
    )

Source from the content-addressed store, hash-verified

85
86impl FileFormatFactory for JsonFormatFactory {
87 fn create(
88 &self,
89 state: &dyn Session,
90 format_options: &HashMap<String, String>,
91 ) -> Result<Arc<dyn FileFormat>> {
92 let json_options = match &self.options {
93 None => {
94 let mut table_options = state.default_table_options();
95 table_options.set_config_format(ConfigFileType::JSON);
96 table_options.alter_with_string_hash_map(format_options)?;
97 table_options.json
98 }
99 Some(json_options) => {
100 let mut json_options = json_options.clone();
101 for (k, v) in format_options {
102 json_options.set(k, v)?;
103 }
104 json_options
105 }
106 };
107
108 Ok(Arc::new(JsonFormat::default().with_options(json_options)))
109 }
110
111 fn default(&self) -> Arc<dyn FileFormat> {
112 Arc::new(JsonFormat::default())

Callers

nothing calls this directly

Calls 7

newFunction · 0.85
set_config_formatMethod · 0.80
default_table_optionsMethod · 0.45
cloneMethod · 0.45
setMethod · 0.45
with_optionsMethod · 0.45

Tested by

no test coverage detected