Commit fd542c6
Fix FilterExec converting Absent column stats to Exact(NULL) (apache#20391)
## Which issue does this PR close?
- Closes apache#20388.
## Rationale for this change
`collect_new_statistics` in `FilterExec` wraps NULL interval bounds in
`Precision::Exact`, converting what should be `Precision::Absent` column
statistics into `Precision::Exact(ScalarValue::Int32(None))`.
Downstream, `estimate_disjoint_inputs` treats these as real bounds and
incorrectly concludes join inputs are disjoint, forcing Partitioned join
mode and disabling dynamic filter pushdown for Parquet row group
pruning.
## What changes are included in this PR?
Single change to `collect_new_statistics` in `filter.rs`: check
`is_null()` on interval bounds before wrapping in `Precision`, mapping
NULL bounds back to `Absent`.
## Are these changes tested?
Yes — includes a regression test
(`test_filter_statistics_absent_columns_stay_absent`) that fails on
current main and passes with the fix.
## Are there any user-facing changes?
No API changes. Corrects statistics propagation for tables/views with
absent column statistics.
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 7698fdc commit fd542c6
1 file changed
+54
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
755 | 770 | | |
756 | 771 | | |
757 | 772 | | |
| |||
784 | 799 | | |
785 | 800 | | |
786 | 801 | | |
787 | | - | |
788 | | - | |
789 | | - | |
790 | | - | |
791 | | - | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
792 | 805 | | |
793 | 806 | | |
794 | 807 | | |
| |||
2066 | 2079 | | |
2067 | 2080 | | |
2068 | 2081 | | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
2069 | 2118 | | |
0 commit comments