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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to