Xuanwo commented on code in PR #231: URL: https://github.com/apache/iceberg-rust/pull/231#discussion_r1519129192
########## crates/iceberg/src/expr/predicate.rs: ########## @@ -406,13 +635,239 @@ mod tests { #[test] fn test_predicate_negate_set() { - let expression = Reference::new("a").is_in(HashSet::from([Datum::long(5), Datum::long(6)])); + let expression = Reference::new("a").is_in([Datum::long(5), Datum::long(6)]); - let expected = - Reference::new("a").is_not_in(HashSet::from([Datum::long(5), Datum::long(6)])); + let expected = Reference::new("a").is_not_in([Datum::long(5), Datum::long(6)]); Review Comment: This test case is unclear to me. Perhaps we should directly compare it with the actual result? It's possible that both `is_in` and `is_not_in` were implemented incorrectly. ########## crates/iceberg/src/expr/predicate.rs: ########## @@ -55,6 +60,24 @@ impl<T, const N: usize> LogicalExpression<T, N> { } } +impl<T: Bind, const N: usize> Bind for LogicalExpression<T, N> +where + T::Bound: Sized, +{ + type Bound = LogicalExpression<T::Bound, N>; + + fn bind(self, schema: SchemaRef, case_sensitive: bool) -> Result<Self::Bound> { + let mut outputs: [Option<Box<T::Bound>>; N] = array_init(|_| None); + for (i, input) in self.inputs.into_iter().enumerate() { + outputs[i] = Some(Box::new(input.bind(schema.clone(), case_sensitive)?)); + } + + // It's safe to use `unwrap` here since they are all `Some`. Review Comment: A bit confused. Why we need to create `[Some(T)]` and unwrap them one by one? -- 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