Repository navigation
Commit 5b0705c
committed
perf: keep CASE WHEN eager when a branch compares floats
`is_infallible` in `case_when.rs` accepted the `BinaryExpr` of normalized
operands that a float comparison used to be, but not the `SparkComparison`
that replaced it. A CASE WHEN or IF with a float comparison in a later WHEN
or in a branch value therefore fell back from eager to lazy evaluation.
`SparkComparison::is_infallible` now reports a comparison of two operands of
the same type as unable to fail, which covers every flat Float32 or Float64
comparison. The nested comparators reject a dictionary-encoded leaf against
a plain one, which the logical type check in `spark_comparison` lets through,
so a nested comparison counts only when the types are equal.
The `is_infallible` test builds comparisons through `spark_comparison`, so a
change in what the planner builds shows up there. The contributor guide
describes comparing in place and lists the float comparison kernels.1 parent 1579aae commit 5b0705c
3 files changed
Lines changed: 57 additions & 10 deletions
File tree
- docs/source/contributor-guide
- native/spark-expr/src
- array_funcs
- conditional_funcs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
124 | 129 | | |
125 | 130 | | |
126 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
338 | 352 | | |
339 | 353 | | |
340 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| 399 | + | |
| 400 | + | |
399 | 401 | | |
400 | 402 | | |
401 | 403 | | |
| |||
836 | 838 | | |
837 | 839 | | |
838 | 840 | | |
| 841 | + | |
839 | 842 | | |
840 | 843 | | |
841 | 844 | | |
| |||
1137 | 1140 | | |
1138 | 1141 | | |
1139 | 1142 | | |
| 1143 | + | |
1140 | 1144 | | |
1141 | 1145 | | |
1142 | 1146 | | |
1143 | 1147 | | |
| 1148 | + | |
1144 | 1149 | | |
1145 | 1150 | | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
1146 | 1161 | | |
1147 | 1162 | | |
1148 | 1163 | | |
| |||
1155 | 1170 | | |
1156 | 1171 | | |
1157 | 1172 | | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1158 | 1177 | | |
1159 | 1178 | | |
1160 | 1179 | | |
| |||
1181 | 1200 | | |
1182 | 1201 | | |
1183 | 1202 | | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
1184 | 1210 | | |
1185 | 1211 | | |
1186 | 1212 | | |
1187 | 1213 | | |
1188 | 1214 | | |
1189 | 1215 | | |
1190 | 1216 | | |
| 1217 | + | |
| 1218 | + | |
1191 | 1219 | | |
1192 | 1220 | | |
1193 | 1221 | | |
| |||
0 commit comments