rdettai commented on a change in pull request #1141:
URL: https://github.com/apache/arrow-datafusion/pull/1141#discussion_r738766844
##########
File path: ballista/rust/core/src/serde/physical_plan/to_proto.rs
##########
@@ -244,90 +246,29 @@ impl TryInto<protobuf::PhysicalPlanNode> for Arc<dyn
ExecutionPlan> {
))),
})
} else if let Some(exec) = plan.downcast_ref::<CsvExec>() {
- let file_groups = exec
- .file_groups()
- .iter()
- .map(|p| p.as_slice().into())
- .collect();
Ok(protobuf::PhysicalPlanNode {
physical_plan_type: Some(PhysicalPlanType::CsvScan(
protobuf::CsvScanExecNode {
- file_groups,
- statistics: Some((&exec.statistics()).into()),
- limit: exec
- .limit()
- .map(|l| protobuf::ScanLimit { limit: l as u32 }),
- projection: exec
- .projection()
- .as_ref()
- .ok_or_else(|| {
- BallistaError::General(
- "projection in CsvExec does not
exist.".to_owned(),
- )
- })?
- .iter()
- .map(|n| *n as u32)
- .collect(),
- schema: Some(exec.file_schema().as_ref().into()),
+ base_conf: Some(exec.base_config().try_into()?),
has_header: exec.has_header(),
delimiter: byte_to_string(exec.delimiter())?,
- batch_size: exec.batch_size() as u32,
},
)),
})
} else if let Some(exec) = plan.downcast_ref::<ParquetExec>() {
- let file_groups = exec
- .file_groups()
- .iter()
- .map(|p| p.as_slice().into())
- .collect();
-
Ok(protobuf::PhysicalPlanNode {
physical_plan_type: Some(PhysicalPlanType::ParquetScan(
protobuf::ParquetScanExecNode {
- file_groups,
- statistics: Some((&exec.statistics()).into()),
- limit: exec
- .limit()
- .map(|l| protobuf::ScanLimit { limit: l as u32 }),
- schema: Some(exec.schema().as_ref().into()),
- projection: exec
- .projection()
- .as_ref()
- .iter()
- .map(|n| *n as u32)
- .collect(),
- batch_size: exec.batch_size() as u32,
+ base_conf: Some(exec.base_config().try_into()?),
+ // TODO serialize predicates
Review comment:
This was already there.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]