You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/08/10 16:05:15 UTC

[GitHub] [arrow] alamb commented on a change in pull request #7925: ARROW-9683: [Rust][DataFusion] Add debug printing to physical plans and associated types

alamb commented on a change in pull request #7925:
URL: https://github.com/apache/arrow/pull/7925#discussion_r468013697



##########
File path: rust/datafusion/src/execution/physical_plan/datasource.rs
##########
@@ -61,6 +73,12 @@ pub struct DatasourcePartition {
     batch_iter: Arc<Mutex<dyn RecordBatchReader + Send + Sync>>,
 }
 
+impl Debug for DatasourcePartition {

Review comment:
       `RecordBatchReader` does not implement `Debug` so had to implement directly here. 

##########
File path: rust/datafusion/src/execution/physical_plan/udf.rs
##########
@@ -44,6 +45,17 @@ pub struct ScalarFunction {
     pub fun: ScalarUdf,
 }
 
+impl Debug for ScalarFunction {
+    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
+        f.debug_struct("ScalarFunction")
+            .field("name", &self.name)
+            .field("args", &self.args)
+            .field("return_type", &self.return_type)
+            .field("fun", &"<FUNC>")

Review comment:
       The `ScanarUdf` [link](https://github.com/apache/arrow/pull/7925/files#diff-96f2be3b05d938f6992c8c22d6dd9609L32) is typedef'd to a function pointer and does not implement `Debug` leading to the two implementations in this file

##########
File path: rust/datafusion/src/execution/physical_plan/parquet.rs
##########
@@ -110,6 +112,12 @@ struct ParquetPartition {
     iterator: Arc<Mutex<dyn RecordBatchReader + Send + Sync>>,
 }
 
+impl Debug for ParquetPartition {
+    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
+        f.debug_struct("ParquetPartition").finish()

Review comment:
       As above, this is not `#derive` because `RecordBatchReader` does not implement `Debug`




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org