jackwener commented on code in PR #4519:
URL: https://github.com/apache/arrow-datafusion/pull/4519#discussion_r1043520191


##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -3109,13 +3173,16 @@ mod tests {
             ((Operator::GtEq, 200), (0.0, 1, 100)),
         ];
 
-        for ((operator, rhs), (exp_selectivity, _, _)) in cases {
+        for ((operator, rhs), (exp_selectivity, exp_min, exp_max)) in cases {
             let context = AnalysisContext::from_statistics(&schema, 
&statistics);
             let left = col("a", &schema).unwrap();
             let right = ScalarValue::Int64(Some(rhs));
-            let boundaries =
-                analyze_expr_scalar_comparison(&operator, &context, &left, 
right)
-                    .expect("this case should not return None");
+            let analysis_ctx =
+                analyze_expr_scalar_comparison(context, &operator, &left, 
right);
+            let boundaries = analysis_ctx
+                .clone()
+                .boundaries

Review Comment:
   look like we can
   ```suggestion
                   .boundaries
                   .clone()
   ```



##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -3109,13 +3173,16 @@ mod tests {
             ((Operator::GtEq, 200), (0.0, 1, 100)),
         ];
 
-        for ((operator, rhs), (exp_selectivity, _, _)) in cases {
+        for ((operator, rhs), (exp_selectivity, exp_min, exp_max)) in cases {
             let context = AnalysisContext::from_statistics(&schema, 
&statistics);
             let left = col("a", &schema).unwrap();
             let right = ScalarValue::Int64(Some(rhs));
-            let boundaries =
-                analyze_expr_scalar_comparison(&operator, &context, &left, 
right)
-                    .expect("this case should not return None");
+            let analysis_ctx =
+                analyze_expr_scalar_comparison(context, &operator, &left, 
right);
+            let boundaries = analysis_ctx
+                .clone()
+                .boundaries

Review Comment:
   have saw @alamb has commented with similar comments below, his code is 
correct.
   



-- 
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