You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by wj...@apache.org on 2023/09/11 02:41:28 UTC

[arrow-datafusion] 01/01: fix test to be false or null, not true

This is an automated email from the ASF dual-hosted git repository.

wjones127 pushed a commit to branch 6171-simplify-with-guarantee
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git

commit 16d78c64d15946ed59c40f92e609094c50cdd3d5
Author: Will Jones <wi...@gmail.com>
AuthorDate: Sun Sep 10 17:22:02 2023 -0700

    fix test to be false or null, not true
---
 datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs | 4 ++--
 datafusion/physical-expr/src/intervals/interval_aritmetic.rs     | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs b/datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs
index edea3a7b95..9b3f710ea8 100644
--- a/datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs
+++ b/datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs
@@ -3271,7 +3271,7 @@ mod tests {
         let output = simplify_with_guarantee(expr.clone(), &guarantees);
         assert_eq!(output, lit(false));
 
-        // Guaranteed true or null -> no change.
+        // Guaranteed false or null -> no change.
         let guarantees = vec![
             (
                 col("c3"),
@@ -3283,7 +3283,7 @@ mod tests {
             (
                 col("c4"),
                 NullableInterval {
-                    values: Interval::make(Some(0_u32), Some(5_u32), (false, false)),
+                    values: Interval::make(Some(9_u32), Some(9_u32), (false, false)),
                     is_valid: Interval::UNCERTAIN,
                 },
             ),
diff --git a/datafusion/physical-expr/src/intervals/interval_aritmetic.rs b/datafusion/physical-expr/src/intervals/interval_aritmetic.rs
index 7dcf331751..caf15dac7d 100644
--- a/datafusion/physical-expr/src/intervals/interval_aritmetic.rs
+++ b/datafusion/physical-expr/src/intervals/interval_aritmetic.rs
@@ -743,19 +743,19 @@ enum NullStatus {
 /// NullableInterval {
 ///    values: Interval::make(Some(1), Some(2), (false, true)),
 ///    is_valid: Interval::UNCERTAIN,
-/// }
+/// };
 ///
 /// // (0, ∞)
 /// NullableInterval {
 ///   values: Interval::make(Some(0), None, (true, true)),
 ///   is_valid: Interval::CERTAINLY_TRUE,
-/// }
+/// };
 ///
 /// // {NULL}
-/// NullableInterval::from(ScalarValue::Int32(None))
+/// NullableInterval::from(&ScalarValue::Int32(None));
 ///
 /// // {4}
-/// NullableInterval::from(ScalarValue::Int32(4))
+/// NullableInterval::from(&ScalarValue::Int32(Some(4)));
 /// ```
 #[derive(Debug, Clone, PartialEq, Eq, Default)]
 pub struct NullableInterval {