(
data_source_exec: &DataSourceExec,
codec: &dyn PhysicalExtensionCodec,
proto_converter: &dyn PhysicalProtoConverterExtension,
)
| 2998 | } |
| 2999 | |
| 3000 | fn try_from_data_source_exec( |
| 3001 | data_source_exec: &DataSourceExec, |
| 3002 | codec: &dyn PhysicalExtensionCodec, |
| 3003 | proto_converter: &dyn PhysicalProtoConverterExtension, |
| 3004 | ) -> Result<Option<Self>> { |
| 3005 | let data_source = data_source_exec.data_source(); |
| 3006 | if let Some(maybe_csv) = data_source.downcast_ref::<FileScanConfig>() { |
| 3007 | let source = maybe_csv.file_source(); |
| 3008 | if let Some(csv_config) = source.downcast_ref::<CsvSource>() { |
| 3009 | return Ok(Some(protobuf::PhysicalPlanNode { |
| 3010 | physical_plan_type: Some(PhysicalPlanType::CsvScan( |
| 3011 | protobuf::CsvScanExecNode { |
| 3012 | base_conf: Some(serialize_file_scan_config( |
| 3013 | maybe_csv, |
| 3014 | codec, |
| 3015 | proto_converter, |
| 3016 | )?), |
| 3017 | has_header: csv_config.has_header(), |
| 3018 | delimiter: byte_to_string( |
| 3019 | csv_config.delimiter(), |
| 3020 | "delimiter", |
| 3021 | )?, |
| 3022 | quote: byte_to_string(csv_config.quote(), "quote")?, |
| 3023 | optional_escape: if let Some(escape) = csv_config.escape() { |
| 3024 | Some( |
| 3025 | protobuf::csv_scan_exec_node::OptionalEscape::Escape( |
| 3026 | byte_to_string(escape, "escape")?, |
| 3027 | ), |
| 3028 | ) |
| 3029 | } else { |
| 3030 | None |
| 3031 | }, |
| 3032 | optional_comment: if let Some(comment) = csv_config.comment() |
| 3033 | { |
| 3034 | Some(protobuf::csv_scan_exec_node::OptionalComment::Comment( |
| 3035 | byte_to_string(comment, "comment")?, |
| 3036 | )) |
| 3037 | } else { |
| 3038 | None |
| 3039 | }, |
| 3040 | newlines_in_values: csv_config.newlines_in_values(), |
| 3041 | truncate_rows: csv_config.truncate_rows(), |
| 3042 | }, |
| 3043 | )), |
| 3044 | })); |
| 3045 | } |
| 3046 | } |
| 3047 | |
| 3048 | if let Some(scan_conf) = data_source.downcast_ref::<FileScanConfig>() { |
| 3049 | let source = scan_conf.file_source(); |
| 3050 | if let Some(_json_source) = source.downcast_ref::<JsonSource>() { |
| 3051 | return Ok(Some(protobuf::PhysicalPlanNode { |
| 3052 | physical_plan_type: Some(PhysicalPlanType::JsonScan( |
| 3053 | protobuf::JsonScanExecNode { |
| 3054 | base_conf: Some(serialize_file_scan_config( |
| 3055 | scan_conf, |
| 3056 | codec, |
| 3057 | proto_converter, |
nothing calls this directly
no test coverage detected