rdettai commented on a change in pull request #1141:
URL: https://github.com/apache/arrow-datafusion/pull/1141#discussion_r738768467



##########
File path: ballista/rust/core/src/serde/physical_plan/to_proto.rs
##########
@@ -722,3 +675,32 @@ impl From<&Statistics> for protobuf::Statistics {
         }
     }
 }
+
+impl TryFrom<&PhysicalPlanConfig> for protobuf::FileScanExecConf {
+    type Error = BallistaError;
+    fn try_from(
+        conf: &PhysicalPlanConfig,
+    ) -> Result<protobuf::FileScanExecConf, Self::Error> {
+        let file_groups = conf
+            .file_groups
+            .iter()
+            .map(|p| p.as_slice().try_into())
+            .collect::<Result<Vec<_>, _>>()?;
+
+        Ok(protobuf::FileScanExecConf {
+            file_groups,
+            statistics: Some((&conf.statistics).into()),
+            limit: conf.limit.map(|l| protobuf::ScanLimit { limit: l as u32 }),
+            projection: conf
+                .projection
+                .as_ref()
+                .unwrap_or(&vec![])

Review comment:
       `None` is encoded with empty vec. Not the cleanest but works here as 
projection with no column could not have another meaning.




-- 
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]


Reply via email to