mbutrovich commented on code in PR #7658:
URL: https://github.com/apache/datafusion-comet/pull/7658#discussion_r4775798753
##########
native/spark-expr/benches/check_overflow.rs:
##########
@@ -85,6 +95,9 @@ fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("check_overflow: ansi no overflow", |b| {
b.iter(|| black_box(ansi.evaluate(black_box(&no_overflow)).unwrap()))
});
+ c.bench_function("check_overflow: ansi no overflow, with nulls", |b| {
+ b.iter(||
black_box(ansi.evaluate(black_box(&no_overflow_nulls)).unwrap()))
+ });
Review Comment:
> I also added `no overflow, null slot out of range`, the worst case for a
scan that includes null slots: the `with nulls` batch with a value that doesn't
fit in its last slot, which is null.
With the resume, this shape stops the scan once, reads one validity bit, and
resumes at the end of the batch. The input that costs the resume loop the most
has many null slots that don't fit, because the scan stops at each of them,
reads its validity bit, and starts `position` again at the next slot
([`fits_precision`](https://github.com/apache/datafusion-comet/blob/00b32efd059383ae6eb6aa8a45ca06906b843f62/native/spark-expr/src/math_funcs/internal/checkoverflow.rs#L277-L287)).
Could we add a shape that puts `OVERFLOW_VALUE` in every null slot of `with
nulls` and of `dense nulls`, and add its numbers next to `main`'s in the
description? Could the description also say whether `CheckOverflow`'s input can
hold such values in null slots in practice, that is, which child expressions
write a value into a null slot?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]