liurenjie1024 commented on code in PR #588:
URL: https://github.com/apache/iceberg-rust/pull/588#discussion_r1749056511


##########
crates/integrations/datafusion/src/physical_plan/expr_to_predicate.rs:
##########
@@ -0,0 +1,312 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::collections::VecDeque;
+
+use datafusion::common::tree_node::{TreeNodeRecursion, TreeNodeVisitor};
+use datafusion::common::Column;
+use datafusion::error::DataFusionError;
+use datafusion::logical_expr::{Expr, Operator};
+use datafusion::scalar::ScalarValue;
+use iceberg::expr::{Predicate, Reference};
+use iceberg::spec::Datum;
+
+pub struct ExprToPredicateVisitor {
+    stack: VecDeque<Option<Predicate>>,
+}
+impl ExprToPredicateVisitor {
+    /// Create a new predicate conversion visitor.
+    pub fn new() -> Self {
+        Self {
+            stack: VecDeque::new(),
+        }
+    }
+    /// Get the predicate from the stack.
+    pub fn get_predicate(&self) -> Option<Predicate> {
+        self.stack
+            .iter()
+            .filter_map(|opt| opt.clone())
+            .reduce(Predicate::and)
+    }
+
+    /// Convert a column expression to an iceberg predicate.
+    fn convert_column_expr(
+        &self,
+        col: &Column,
+        op: &Operator,
+        lit: &ScalarValue,
+    ) -> Option<Predicate> {
+        let reference = Reference::new(col.name.clone());
+        let datum = scalar_value_to_datum(lit)?;
+        Some(binary_op_to_predicate(reference, op, datum))
+    }
+
+    /// Convert a compound expression to an iceberg predicate.
+    ///
+    /// The strategy is to support the following cases:
+    /// - if its an AND expression then the result will be the valid 
predicates, whether there are 2 or just 1
+    /// - if its an OR expression then a predicate will be returned only if 
there are 2 valid predicates on both sides
+    fn convert_compound_expr(&self, valid_preds: &[Predicate], op: &Operator) 
-> Option<Predicate> {
+        let valid_preds_count = valid_preds.len();
+        match (op, valid_preds_count) {
+            (Operator::And, 1) => valid_preds.first().cloned(),
+            (Operator::And, 2) => Some(Predicate::and(
+                valid_preds[0].clone(),
+                valid_preds[1].clone(),
+            )),
+            (Operator::Or, 2) => Some(Predicate::or(
+                valid_preds[0].clone(),
+                valid_preds[1].clone(),
+            )),
+            _ => None,
+        }
+    }
+}
+
+// Implement TreeNodeVisitor for ExprToPredicateVisitor
+impl<'n> TreeNodeVisitor<'n> for ExprToPredicateVisitor {
+    type Node = Expr;
+
+    fn f_down(&mut self, _node: &'n Self::Node) -> Result<TreeNodeRecursion, 
DataFusionError> {
+        Ok(TreeNodeRecursion::Continue)
+    }
+
+    fn f_up(&mut self, node: &'n Self::Node) -> Result<TreeNodeRecursion, 
DataFusionError> {
+        if let Expr::BinaryExpr(binary) = node {
+            match (&*binary.left, &binary.op, &*binary.right) {
+                // process simple expressions (involving a column, operator 
and literal)
+                (Expr::Column(col), op, Expr::Literal(lit)) => {

Review Comment:
   Will this visitor visit leaf nodes such as `Expr::Column`? This pattern 
doesn't seem flexible to me, for example, I believe we could also support 
things like `a > 6`, `6 < a`.



##########
crates/integrations/datafusion/src/physical_plan/expr_to_predicate.rs:
##########
@@ -0,0 +1,312 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::collections::VecDeque;
+
+use datafusion::common::tree_node::{TreeNodeRecursion, TreeNodeVisitor};
+use datafusion::common::Column;
+use datafusion::error::DataFusionError;
+use datafusion::logical_expr::{Expr, Operator};
+use datafusion::scalar::ScalarValue;
+use iceberg::expr::{Predicate, Reference};
+use iceberg::spec::Datum;
+
+pub struct ExprToPredicateVisitor {
+    stack: VecDeque<Option<Predicate>>,
+}
+impl ExprToPredicateVisitor {
+    /// Create a new predicate conversion visitor.
+    pub fn new() -> Self {
+        Self {
+            stack: VecDeque::new(),
+        }
+    }
+    /// Get the predicate from the stack.
+    pub fn get_predicate(&self) -> Option<Predicate> {
+        self.stack
+            .iter()
+            .filter_map(|opt| opt.clone())
+            .reduce(Predicate::and)
+    }
+
+    /// Convert a column expression to an iceberg predicate.
+    fn convert_column_expr(
+        &self,
+        col: &Column,
+        op: &Operator,
+        lit: &ScalarValue,
+    ) -> Option<Predicate> {
+        let reference = Reference::new(col.name.clone());
+        let datum = scalar_value_to_datum(lit)?;
+        Some(binary_op_to_predicate(reference, op, datum))
+    }
+
+    /// Convert a compound expression to an iceberg predicate.
+    ///
+    /// The strategy is to support the following cases:
+    /// - if its an AND expression then the result will be the valid 
predicates, whether there are 2 or just 1
+    /// - if its an OR expression then a predicate will be returned only if 
there are 2 valid predicates on both sides
+    fn convert_compound_expr(&self, valid_preds: &[Predicate], op: &Operator) 
-> Option<Predicate> {
+        let valid_preds_count = valid_preds.len();
+        match (op, valid_preds_count) {
+            (Operator::And, 1) => valid_preds.first().cloned(),
+            (Operator::And, 2) => Some(Predicate::and(
+                valid_preds[0].clone(),
+                valid_preds[1].clone(),
+            )),
+            (Operator::Or, 2) => Some(Predicate::or(
+                valid_preds[0].clone(),
+                valid_preds[1].clone(),
+            )),
+            _ => None,
+        }
+    }
+}
+
+// Implement TreeNodeVisitor for ExprToPredicateVisitor
+impl<'n> TreeNodeVisitor<'n> for ExprToPredicateVisitor {
+    type Node = Expr;
+
+    fn f_down(&mut self, _node: &'n Self::Node) -> Result<TreeNodeRecursion, 
DataFusionError> {
+        Ok(TreeNodeRecursion::Continue)
+    }
+
+    fn f_up(&mut self, node: &'n Self::Node) -> Result<TreeNodeRecursion, 
DataFusionError> {

Review Comment:
   Ditto.



##########
crates/integrations/datafusion/src/physical_plan/expr_to_predicate.rs:
##########
@@ -0,0 +1,312 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::collections::VecDeque;
+
+use datafusion::common::tree_node::{TreeNodeRecursion, TreeNodeVisitor};
+use datafusion::common::Column;
+use datafusion::error::DataFusionError;
+use datafusion::logical_expr::{Expr, Operator};
+use datafusion::scalar::ScalarValue;
+use iceberg::expr::{Predicate, Reference};
+use iceberg::spec::Datum;
+
+pub struct ExprToPredicateVisitor {
+    stack: VecDeque<Option<Predicate>>,
+}
+impl ExprToPredicateVisitor {
+    /// Create a new predicate conversion visitor.
+    pub fn new() -> Self {
+        Self {
+            stack: VecDeque::new(),
+        }
+    }
+    /// Get the predicate from the stack.
+    pub fn get_predicate(&self) -> Option<Predicate> {
+        self.stack
+            .iter()
+            .filter_map(|opt| opt.clone())
+            .reduce(Predicate::and)
+    }
+
+    /// Convert a column expression to an iceberg predicate.
+    fn convert_column_expr(
+        &self,
+        col: &Column,
+        op: &Operator,
+        lit: &ScalarValue,
+    ) -> Option<Predicate> {
+        let reference = Reference::new(col.name.clone());
+        let datum = scalar_value_to_datum(lit)?;
+        Some(binary_op_to_predicate(reference, op, datum))
+    }
+
+    /// Convert a compound expression to an iceberg predicate.
+    ///
+    /// The strategy is to support the following cases:
+    /// - if its an AND expression then the result will be the valid 
predicates, whether there are 2 or just 1
+    /// - if its an OR expression then a predicate will be returned only if 
there are 2 valid predicates on both sides
+    fn convert_compound_expr(&self, valid_preds: &[Predicate], op: &Operator) 
-> Option<Predicate> {
+        let valid_preds_count = valid_preds.len();
+        match (op, valid_preds_count) {
+            (Operator::And, 1) => valid_preds.first().cloned(),
+            (Operator::And, 2) => Some(Predicate::and(
+                valid_preds[0].clone(),
+                valid_preds[1].clone(),
+            )),
+            (Operator::Or, 2) => Some(Predicate::or(
+                valid_preds[0].clone(),
+                valid_preds[1].clone(),
+            )),
+            _ => None,
+        }
+    }
+}
+
+// Implement TreeNodeVisitor for ExprToPredicateVisitor
+impl<'n> TreeNodeVisitor<'n> for ExprToPredicateVisitor {
+    type Node = Expr;
+
+    fn f_down(&mut self, _node: &'n Self::Node) -> Result<TreeNodeRecursion, 
DataFusionError> {

Review Comment:
   ```suggestion
       fn f_down(&mut self, _node: &Expr) -> Result<TreeNodeRecursion, 
DataFusionError> {
   ```
   
   I would suggest to use concrete type to make it more readable.



##########
crates/integrations/datafusion/src/physical_plan/expr_to_predicate.rs:
##########
@@ -0,0 +1,312 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::collections::VecDeque;
+
+use datafusion::common::tree_node::{TreeNodeRecursion, TreeNodeVisitor};
+use datafusion::common::Column;
+use datafusion::error::DataFusionError;
+use datafusion::logical_expr::{Expr, Operator};
+use datafusion::scalar::ScalarValue;
+use iceberg::expr::{Predicate, Reference};
+use iceberg::spec::Datum;
+
+pub struct ExprToPredicateVisitor {
+    stack: VecDeque<Option<Predicate>>,
+}
+impl ExprToPredicateVisitor {
+    /// Create a new predicate conversion visitor.
+    pub fn new() -> Self {
+        Self {
+            stack: VecDeque::new(),
+        }
+    }
+    /// Get the predicate from the stack.
+    pub fn get_predicate(&self) -> Option<Predicate> {
+        self.stack
+            .iter()
+            .filter_map(|opt| opt.clone())
+            .reduce(Predicate::and)
+    }
+
+    /// Convert a column expression to an iceberg predicate.
+    fn convert_column_expr(
+        &self,
+        col: &Column,
+        op: &Operator,
+        lit: &ScalarValue,
+    ) -> Option<Predicate> {
+        let reference = Reference::new(col.name.clone());
+        let datum = scalar_value_to_datum(lit)?;
+        Some(binary_op_to_predicate(reference, op, datum))
+    }
+
+    /// Convert a compound expression to an iceberg predicate.
+    ///
+    /// The strategy is to support the following cases:
+    /// - if its an AND expression then the result will be the valid 
predicates, whether there are 2 or just 1
+    /// - if its an OR expression then a predicate will be returned only if 
there are 2 valid predicates on both sides
+    fn convert_compound_expr(&self, valid_preds: &[Predicate], op: &Operator) 
-> Option<Predicate> {
+        let valid_preds_count = valid_preds.len();
+        match (op, valid_preds_count) {
+            (Operator::And, 1) => valid_preds.first().cloned(),

Review Comment:
   I'm a little confusing about this case, when will this be valid?



##########
crates/integrations/datafusion/src/physical_plan/expr_to_predicate.rs:
##########
@@ -0,0 +1,312 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::collections::VecDeque;
+
+use datafusion::common::tree_node::{TreeNodeRecursion, TreeNodeVisitor};
+use datafusion::common::Column;
+use datafusion::error::DataFusionError;
+use datafusion::logical_expr::{Expr, Operator};
+use datafusion::scalar::ScalarValue;
+use iceberg::expr::{Predicate, Reference};
+use iceberg::spec::Datum;
+
+pub struct ExprToPredicateVisitor {
+    stack: VecDeque<Option<Predicate>>,
+}
+impl ExprToPredicateVisitor {
+    /// Create a new predicate conversion visitor.
+    pub fn new() -> Self {
+        Self {
+            stack: VecDeque::new(),
+        }
+    }
+    /// Get the predicate from the stack.
+    pub fn get_predicate(&self) -> Option<Predicate> {
+        self.stack
+            .iter()
+            .filter_map(|opt| opt.clone())
+            .reduce(Predicate::and)
+    }
+
+    /// Convert a column expression to an iceberg predicate.
+    fn convert_column_expr(
+        &self,
+        col: &Column,
+        op: &Operator,
+        lit: &ScalarValue,
+    ) -> Option<Predicate> {
+        let reference = Reference::new(col.name.clone());
+        let datum = scalar_value_to_datum(lit)?;
+        Some(binary_op_to_predicate(reference, op, datum))
+    }
+
+    /// Convert a compound expression to an iceberg predicate.
+    ///
+    /// The strategy is to support the following cases:
+    /// - if its an AND expression then the result will be the valid 
predicates, whether there are 2 or just 1
+    /// - if its an OR expression then a predicate will be returned only if 
there are 2 valid predicates on both sides
+    fn convert_compound_expr(&self, valid_preds: &[Predicate], op: &Operator) 
-> Option<Predicate> {
+        let valid_preds_count = valid_preds.len();
+        match (op, valid_preds_count) {
+            (Operator::And, 1) => valid_preds.first().cloned(),
+            (Operator::And, 2) => Some(Predicate::and(
+                valid_preds[0].clone(),
+                valid_preds[1].clone(),
+            )),
+            (Operator::Or, 2) => Some(Predicate::or(
+                valid_preds[0].clone(),
+                valid_preds[1].clone(),
+            )),
+            _ => None,
+        }
+    }
+}
+
+// Implement TreeNodeVisitor for ExprToPredicateVisitor
+impl<'n> TreeNodeVisitor<'n> for ExprToPredicateVisitor {
+    type Node = Expr;
+
+    fn f_down(&mut self, _node: &'n Self::Node) -> Result<TreeNodeRecursion, 
DataFusionError> {
+        Ok(TreeNodeRecursion::Continue)
+    }
+
+    fn f_up(&mut self, node: &'n Self::Node) -> Result<TreeNodeRecursion, 
DataFusionError> {
+        if let Expr::BinaryExpr(binary) = node {
+            match (&*binary.left, &binary.op, &*binary.right) {
+                // process simple expressions (involving a column, operator 
and literal)
+                (Expr::Column(col), op, Expr::Literal(lit)) => {
+                    let col_pred = self.convert_column_expr(col, op, lit);
+                    self.stack.push_back(col_pred);
+                }
+                // process compound expressions (involving AND or OR and 
children)
+                (_left, op, _right) if matches!(op, Operator::And | 
Operator::Or) => {
+                    let right_pred = self.stack.pop_back().flatten();
+                    let left_pred = self.stack.pop_back().flatten();
+                    let children: Vec<_> = [left_pred, 
right_pred].into_iter().flatten().collect();
+                    let compound_pred = self.convert_compound_expr(&children, 
op);
+                    self.stack.push_back(compound_pred);
+                }
+                _ => {}
+            }
+        };
+        Ok(TreeNodeRecursion::Continue)
+    }
+}
+
+const MILLIS_PER_DAY: i64 = 24 * 60 * 60 * 1000;
+/// Convert a scalar value to an iceberg datum.
+fn scalar_value_to_datum(value: &ScalarValue) -> Option<Datum> {
+    match value {
+        ScalarValue::Int8(Some(v)) => Some(Datum::int(*v as i32)),
+        ScalarValue::Int16(Some(v)) => Some(Datum::int(*v as i32)),
+        ScalarValue::Int32(Some(v)) => Some(Datum::int(*v)),
+        ScalarValue::Int64(Some(v)) => Some(Datum::long(*v)),
+        ScalarValue::Float32(Some(v)) => Some(Datum::double(*v as f64)),
+        ScalarValue::Float64(Some(v)) => Some(Datum::double(*v)),
+        ScalarValue::Utf8(Some(v)) => Some(Datum::string(v.clone())),
+        ScalarValue::LargeUtf8(Some(v)) => Some(Datum::string(v.clone())),
+        ScalarValue::Date32(Some(v)) => Some(Datum::date(*v)),
+        ScalarValue::Date64(Some(v)) => Some(Datum::date((*v / MILLIS_PER_DAY) 
as i32)),
+        _ => None,
+    }
+}
+
+/// convert the data fusion Exp to an iceberg [`Predicate`]
+fn binary_op_to_predicate(reference: Reference, op: &Operator, datum: Datum) 
-> Predicate {
+    match op {
+        Operator::Eq => reference.equal_to(datum),
+        Operator::NotEq => reference.not_equal_to(datum),
+        Operator::Lt => reference.less_than(datum),
+        Operator::LtEq => reference.less_than_or_equal_to(datum),
+        Operator::Gt => reference.greater_than(datum),
+        Operator::GtEq => reference.greater_than_or_equal_to(datum),
+        _ => Predicate::AlwaysTrue,
+    }
+}
+
+#[cfg(test)]
+mod tests {

Review Comment:
   Thanks for all these tests, really appreciate it!



##########
crates/integrations/datafusion/src/physical_plan/expr_to_predicate.rs:
##########
@@ -0,0 +1,312 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::collections::VecDeque;
+
+use datafusion::common::tree_node::{TreeNodeRecursion, TreeNodeVisitor};
+use datafusion::common::Column;
+use datafusion::error::DataFusionError;
+use datafusion::logical_expr::{Expr, Operator};
+use datafusion::scalar::ScalarValue;
+use iceberg::expr::{Predicate, Reference};
+use iceberg::spec::Datum;
+
+pub struct ExprToPredicateVisitor {
+    stack: VecDeque<Option<Predicate>>,
+}
+impl ExprToPredicateVisitor {
+    /// Create a new predicate conversion visitor.
+    pub fn new() -> Self {
+        Self {
+            stack: VecDeque::new(),
+        }
+    }
+    /// Get the predicate from the stack.
+    pub fn get_predicate(&self) -> Option<Predicate> {
+        self.stack
+            .iter()
+            .filter_map(|opt| opt.clone())
+            .reduce(Predicate::and)
+    }
+
+    /// Convert a column expression to an iceberg predicate.
+    fn convert_column_expr(
+        &self,
+        col: &Column,
+        op: &Operator,
+        lit: &ScalarValue,
+    ) -> Option<Predicate> {
+        let reference = Reference::new(col.name.clone());
+        let datum = scalar_value_to_datum(lit)?;
+        Some(binary_op_to_predicate(reference, op, datum))
+    }
+
+    /// Convert a compound expression to an iceberg predicate.
+    ///
+    /// The strategy is to support the following cases:
+    /// - if its an AND expression then the result will be the valid 
predicates, whether there are 2 or just 1
+    /// - if its an OR expression then a predicate will be returned only if 
there are 2 valid predicates on both sides
+    fn convert_compound_expr(&self, valid_preds: &[Predicate], op: &Operator) 
-> Option<Predicate> {
+        let valid_preds_count = valid_preds.len();
+        match (op, valid_preds_count) {
+            (Operator::And, 1) => valid_preds.first().cloned(),
+            (Operator::And, 2) => Some(Predicate::and(
+                valid_preds[0].clone(),
+                valid_preds[1].clone(),
+            )),
+            (Operator::Or, 2) => Some(Predicate::or(
+                valid_preds[0].clone(),
+                valid_preds[1].clone(),
+            )),
+            _ => None,
+        }
+    }
+}
+
+// Implement TreeNodeVisitor for ExprToPredicateVisitor
+impl<'n> TreeNodeVisitor<'n> for ExprToPredicateVisitor {
+    type Node = Expr;
+
+    fn f_down(&mut self, _node: &'n Self::Node) -> Result<TreeNodeRecursion, 
DataFusionError> {
+        Ok(TreeNodeRecursion::Continue)
+    }
+
+    fn f_up(&mut self, node: &'n Self::Node) -> Result<TreeNodeRecursion, 
DataFusionError> {
+        if let Expr::BinaryExpr(binary) = node {
+            match (&*binary.left, &binary.op, &*binary.right) {
+                // process simple expressions (involving a column, operator 
and literal)
+                (Expr::Column(col), op, Expr::Literal(lit)) => {
+                    let col_pred = self.convert_column_expr(col, op, lit);
+                    self.stack.push_back(col_pred);
+                }
+                // process compound expressions (involving AND or OR and 
children)
+                (_left, op, _right) if matches!(op, Operator::And | 
Operator::Or) => {
+                    let right_pred = self.stack.pop_back().flatten();
+                    let left_pred = self.stack.pop_back().flatten();
+                    let children: Vec<_> = [left_pred, 
right_pred].into_iter().flatten().collect();
+                    let compound_pred = self.convert_compound_expr(&children, 
op);
+                    self.stack.push_back(compound_pred);
+                }
+                _ => {}

Review Comment:
   If there sth not supported, I think the correct behavior should be 
`TreeNodeRecursion::Stop` and clear the stack?



-- 
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: issues-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to