Commit f9231fc
Move
## Which issue does this PR close?
- None, break out PR of changes done in #17813
## Rationale for this change
In #17813 `GuaranteeRewriter` is used from the `datafusion_expr` crate.
In order to enable this the type needed to be moved from
`datafusion_optimizer` to `datafusion_expr`.
Additionally, during the development of #17813 some latent bugs were
discovered in `GuaranteeRewriter` that have been resolved.
## What changes are included in this PR?
- Move `GuaranteeRewriter` to `datafusion_expr`
- Fix two bugs where rewrites of 'between' expression would fail
- when one of the bounds was untyped null
- when the lower bound was greater than the upper bound
- Add logic to replace expressions with literal null based on provided
guarantees
- Split implementation into smaller functions for easier readability
## Are these changes tested?
- Existing tests updated
- Tests added for bugfixes
## Are there any user-facing changes?
No
---------
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>GuaranteeRewriter to datafusion_expr (#18821)1 parent d01c0d3 commit f9231fc
File tree
6 files changed
+696
-492
lines changed- datafusion
- core/tests/optimizer
- expr/src/expr_rewriter
- optimizer/src/simplify_expressions
6 files changed
+696
-492
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
308 | | - | |
309 | 307 | | |
310 | 308 | | |
311 | 309 | | |
| |||
337 | 335 | | |
338 | 336 | | |
339 | 337 | | |
340 | | - | |
| 338 | + | |
341 | 339 | | |
342 | 340 | | |
343 | 341 | | |
| |||
348 | 346 | | |
349 | 347 | | |
350 | 348 | | |
351 | | - | |
| 349 | + | |
352 | 350 | | |
353 | 351 | | |
354 | | - | |
355 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
361 | 363 | | |
362 | 364 | | |
363 | 365 | | |
364 | 366 | | |
365 | 367 | | |
366 | 368 | | |
367 | 369 | | |
368 | | - | |
| 370 | + | |
369 | 371 | | |
370 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
371 | 375 | | |
372 | 376 | | |
373 | 377 | | |
| |||
0 commit comments