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 2022/03/10 15:00:42 UTC

[GitHub] [arrow-datafusion] yjshen removed a comment on pull request #1970: Address typo in ExprVisitable trait documentation

yjshen removed a comment on pull request #1970:
URL: https://github.com/apache/arrow-datafusion/pull/1970#issuecomment-1064154488


   ```rust
   struct Print{}
   
   impl ExpressionVisitor for Print {
       fn pre_visit(self, expr: &Expr) -> datafusion_common::Result<Recursion<Self>> where Self: ExpressionVisitor {
           println!("pre {}", expr);
           Ok(Recursion::Continue(self))
       }
   
       fn post_visit(self, expr: &Expr) -> datafusion_common::Result<Self> {
           println!("post {}", expr);
           Ok(self)
       }
   }
   
   #[test]
   fn a() {
       let a = BinaryExpr {
           left: Box::new(Expr::Column(Column::from_name("foo"))),
           op: Operator::Gt,
           right: Box::new(Expr::Column(Column::from_name("bar")))
       };
       a.accept(Print{}).unwrap();
   }
   ```
   and I get
   ```
   pre #foo > #bar
   pre #foo
   post #foo
   pre #bar
   post #bar
   post #foo > #bar
   ```
   
   
   


-- 
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: github-unsubscribe@arrow.apache.org

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