You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/12/08 15:58:58 UTC
[GitHub] [arrow-datafusion] jackwener commented on a diff in pull request #4519: Enrich filter statistics with known column boundaries
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org