Method
try_encode_file_format
(
&self,
buf: &mut Vec<u8>,
node: Arc<dyn FileFormatFactory>,
)
Source from the content-addressed store, hash-verified
| 237 | } |
| 238 | |
| 239 | fn try_encode_file_format( |
| 240 | &self, |
| 241 | buf: &mut Vec<u8>, |
| 242 | node: Arc<dyn FileFormatFactory>, |
| 243 | ) -> datafusion_common::Result<()> { |
| 244 | let options = if let Some(csv_factory) = node.downcast_ref::<CsvFormatFactory>() { |
| 245 | csv_factory.options.clone().unwrap_or_default() |
| 246 | } else { |
| 247 | return exec_err!("{}", "Unsupported FileFormatFactory type".to_string()); |
| 248 | }; |
| 249 | |
| 250 | let proto = CsvOptionsProto::from_factory(&CsvFormatFactory { |
| 251 | options: Some(options), |
| 252 | }); |
| 253 | |
| 254 | proto |
| 255 | .encode(buf) |
| 256 | .map_err(|e| exec_datafusion_err!("Failed to encode CsvOptions: {e:?}"))?; |
| 257 | |
| 258 | Ok(()) |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | impl JsonOptionsProto { |
Callers
nothing calls this directly
Tested by
no test coverage detected