Commit 14a85fa
chore: remove as_any from aggregate and window functions (#21209)
## Which issue does this PR close?
This is a follow on to #20812
but treats aggregate and window functions.
## Rationale for this change
This PR reduces the amount of boilerplate code that users need to write
for aggregate and window functions.
## What changes are included in this PR?
Now that we have [trait
upcasting](https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/) since
rust 1.86, we no longer need every implementation of these functions to
have the as_any function that returns &self. This PR makes Any an
supertrait and makes the appropriate casts when necessary.
## Are these changes tested?
Existing unit tests.
## Are there any user-facing changes?
Yes, the users simply need to remove the `as_any` function. The upgrade
guide is updated.
---------
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>1 parent 5ff80e4 commit 14a85fa
File tree
51 files changed
+79
-381
lines changed- datafusion-examples/examples/udf
- datafusion
- core/tests/user_defined
- expr/src
- test
- ffi/src
- proto
- udaf
- udwf
- functions-aggregate/src
- functions-window/src
- optimizer/src/simplify_expressions
- physical-expr/src
- proto/tests/cases
- spark/src/function/aggregate
- docs/source/library-user-guide/upgrading
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
51 files changed
+79
-381
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | 67 | | |
73 | 68 | | |
74 | 69 | | |
| |||
387 | 382 | | |
388 | 383 | | |
389 | 384 | | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | 385 | | |
395 | 386 | | |
396 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | 71 | | |
77 | 72 | | |
78 | 73 | | |
| |||
176 | 171 | | |
177 | 172 | | |
178 | 173 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | 174 | | |
184 | 175 | | |
185 | 176 | | |
| |||
Lines changed: 0 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
793 | 792 | | |
794 | 793 | | |
795 | 794 | | |
796 | | - | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | 795 | | |
801 | 796 | | |
802 | 797 | | |
| |||
936 | 931 | | |
937 | 932 | | |
938 | 933 | | |
939 | | - | |
940 | | - | |
941 | | - | |
942 | | - | |
943 | 934 | | |
944 | 935 | | |
945 | 936 | | |
| |||
Lines changed: 0 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| |||
546 | 545 | | |
547 | 546 | | |
548 | 547 | | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | 548 | | |
554 | 549 | | |
555 | 550 | | |
| |||
675 | 670 | | |
676 | 671 | | |
677 | 672 | | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | 673 | | |
683 | 674 | | |
684 | 675 | | |
| |||
819 | 810 | | |
820 | 811 | | |
821 | 812 | | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | 813 | | |
827 | 814 | | |
828 | 815 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| |||
588 | 587 | | |
589 | 588 | | |
590 | 589 | | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | 590 | | |
596 | 591 | | |
597 | 592 | | |
| |||
681 | 676 | | |
682 | 677 | | |
683 | 678 | | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | 679 | | |
689 | 680 | | |
690 | 681 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | 114 | | |
121 | 115 | | |
122 | 116 | | |
| |||
245 | 239 | | |
246 | 240 | | |
247 | 241 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | 242 | | |
253 | 243 | | |
254 | 244 | | |
| |||
332 | 322 | | |
333 | 323 | | |
334 | 324 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | 325 | | |
340 | 326 | | |
341 | 327 | | |
| |||
414 | 400 | | |
415 | 401 | | |
416 | 402 | | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | 403 | | |
422 | 404 | | |
423 | 405 | | |
| |||
476 | 458 | | |
477 | 459 | | |
478 | 460 | | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | 461 | | |
484 | 462 | | |
485 | 463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
419 | 418 | | |
420 | 419 | | |
421 | 420 | | |
| |||
443 | 442 | | |
444 | 443 | | |
445 | 444 | | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
| 445 | + | |
450 | 446 | | |
451 | 447 | | |
452 | 448 | | |
| |||
913 | 909 | | |
914 | 910 | | |
915 | 911 | | |
916 | | - | |
| 912 | + | |
917 | 913 | | |
918 | 914 | | |
919 | 915 | | |
| |||
1231 | 1227 | | |
1232 | 1228 | | |
1233 | 1229 | | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | 1230 | | |
1239 | 1231 | | |
1240 | 1232 | | |
| |||
1415 | 1407 | | |
1416 | 1408 | | |
1417 | 1409 | | |
1418 | | - | |
1419 | 1410 | | |
1420 | 1411 | | |
1421 | 1412 | | |
| |||
1437 | 1428 | | |
1438 | 1429 | | |
1439 | 1430 | | |
1440 | | - | |
1441 | | - | |
1442 | | - | |
1443 | 1431 | | |
1444 | 1432 | | |
1445 | 1433 | | |
| |||
1477 | 1465 | | |
1478 | 1466 | | |
1479 | 1467 | | |
1480 | | - | |
1481 | | - | |
1482 | | - | |
1483 | 1468 | | |
1484 | 1469 | | |
1485 | 1470 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
0 commit comments