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/07/20 20:12:12 UTC

[GitHub] [arrow] andygrove opened a new pull request #7812: ARROW-9507: [Rust] [DataFusion] Implement Display for PhysicalExpr

andygrove opened a new pull request #7812:
URL: https://github.com/apache/arrow/pull/7812


   This allows physical expressions to be printed in a human-readable form and is a step towards a printable physical plan.


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



[GitHub] [arrow] jorgecarleitao commented on a change in pull request #7812: ARROW-9507: [Rust] [DataFusion] Implement Display for PhysicalExpr

Posted by GitBox <gi...@apache.org>.
jorgecarleitao commented on a change in pull request #7812:
URL: https://github.com/apache/arrow/pull/7812#discussion_r457677554



##########
File path: rust/datafusion/src/execution/physical_plan/udf.rs
##########
@@ -84,6 +86,19 @@ impl ScalarFunctionExpr {
     }
 }
 
+impl fmt::Display for ScalarFunctionExpr {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{}(", self.name)?;
+        for i in 0..self.args.len() {

Review comment:
       yeap, forgot that .join required strings. Still better IMO, as it is more expressive.




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



[GitHub] [arrow] andygrove commented on pull request #7812: ARROW-9507: [Rust] [DataFusion] Implement Display for PhysicalExpr

Posted by GitBox <gi...@apache.org>.
andygrove commented on pull request #7812:
URL: https://github.com/apache/arrow/pull/7812#issuecomment-661308588


   fyi @jorgecarleitao 


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



[GitHub] [arrow] jorgecarleitao commented on a change in pull request #7812: ARROW-9507: [Rust] [DataFusion] Implement Display for PhysicalExpr

Posted by GitBox <gi...@apache.org>.
jorgecarleitao commented on a change in pull request #7812:
URL: https://github.com/apache/arrow/pull/7812#discussion_r457673965



##########
File path: rust/datafusion/src/execution/physical_plan/udf.rs
##########
@@ -84,6 +86,19 @@ impl ScalarFunctionExpr {
     }
 }
 
+impl fmt::Display for ScalarFunctionExpr {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{}(", self.name)?;
+        for i in 0..self.args.len() {

Review comment:
       Or, the complete statement, `write!(f, "{}({})", self.name, self.args.join(", "))?;`




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



[GitHub] [arrow] andygrove closed pull request #7812: ARROW-9507: [Rust] [DataFusion] Implement Display for PhysicalExpr

Posted by GitBox <gi...@apache.org>.
andygrove closed pull request #7812:
URL: https://github.com/apache/arrow/pull/7812


   


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



[GitHub] [arrow] jorgecarleitao commented on pull request #7812: ARROW-9507: [Rust] [DataFusion] Implement Display for PhysicalExpr

Posted by GitBox <gi...@apache.org>.
jorgecarleitao commented on pull request #7812:
URL: https://github.com/apache/arrow/pull/7812#issuecomment-661318331


   Left a minor comment, other than that, LGTM. 
   
   I am uncertain whether this should be Debug or Display, but since we haven't formulated a concrete spec on this, Display is fine for now. :)


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



[GitHub] [arrow] github-actions[bot] commented on pull request #7812: ARROW-9507: [Rust] [DataFusion] Implement Display for PhysicalExpr

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #7812:
URL: https://github.com/apache/arrow/pull/7812#issuecomment-661311089


   https://issues.apache.org/jira/browse/ARROW-9507


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



[GitHub] [arrow] andygrove commented on a change in pull request #7812: ARROW-9507: [Rust] [DataFusion] Implement Display for PhysicalExpr

Posted by GitBox <gi...@apache.org>.
andygrove commented on a change in pull request #7812:
URL: https://github.com/apache/arrow/pull/7812#discussion_r457676182



##########
File path: rust/datafusion/src/execution/physical_plan/udf.rs
##########
@@ -84,6 +86,19 @@ impl ScalarFunctionExpr {
     }
 }
 
+impl fmt::Display for ScalarFunctionExpr {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{}(", self.name)?;
+        for i in 0..self.args.len() {

Review comment:
       That wouldn't work but I pushed this change instead:
   
   ```rust
           write!(
               f,
               "{}({})",
               self.name,
               self.args
                   .iter()
                   .map(|e| format!("{}", e))
                   .collect::<Vec<String>>()
                   .join(", ")
           )
   ```




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



[GitHub] [arrow] kszucs commented on pull request #7812: ARROW-9507: [Rust] [DataFusion] Implement Display for PhysicalExpr

Posted by GitBox <gi...@apache.org>.
kszucs commented on pull request #7812:
URL: https://github.com/apache/arrow/pull/7812#issuecomment-664282119


   @andygrove please rebase


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



[GitHub] [arrow] jorgecarleitao commented on a change in pull request #7812: ARROW-9507: [Rust] [DataFusion] Implement Display for PhysicalExpr

Posted by GitBox <gi...@apache.org>.
jorgecarleitao commented on a change in pull request #7812:
URL: https://github.com/apache/arrow/pull/7812#discussion_r457672336



##########
File path: rust/datafusion/src/execution/physical_plan/udf.rs
##########
@@ -84,6 +86,19 @@ impl ScalarFunctionExpr {
     }
 }
 
+impl fmt::Display for ScalarFunctionExpr {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{}(", self.name)?;
+        for i in 0..self.args.len() {

Review comment:
       `self.args.join(", ")`?




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