(
&self,
state: &dyn Session,
format_options: &HashMap<String, String>,
)
| 85 | |
| 86 | impl 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()) |
nothing calls this directly
no test coverage detected