Commit 1a0c2e0
authored
Use return_field_from_args in information schema and date_trunc (#20079)
## Which issue does this PR close?
- Closes #19870.
## Rationale for this change
Some UDFs/UDAFs implement `return_field_from_args` / `return_field`
instead of `return_type`. The information schema was calling
`return_type` directly, which fails for those functions. The default
implementation of `return_field_from_args` already delegates to
`return_type`, so switching to the newer API works for all functions.
## What changes are included in this PR?
- **`information_schema.rs`**: `get_udf_args_and_return_types` now calls
`return_field_from_args` instead of `return_type`;
`get_udaf_args_and_return_types` now calls `return_field` instead of
`return_type`. Removed stale comments referencing the old API.
- **`date_trunc.rs`**: `return_type` now returns `internal_err`, and
`return_field_from_args` is self-contained (no longer delegates to
`return_type`), following the same pattern as other UDFs like
`named_struct` and `map_from_arrays` (ref: #19275).
## Are these changes tested?
Covered by existing information_schema sqllogictests and
`datafusion-functions` unit tests.
## Are there any user-facing changes?
No.1 parent c849374 commit 1a0c2e0
3 files changed
Lines changed: 69 additions & 31 deletions
File tree
- datafusion
- catalog/src
- functions
- benches
- src/datetime
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| |||
421 | 424 | | |
422 | 425 | | |
423 | 426 | | |
424 | | - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
425 | 435 | | |
426 | | - | |
427 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
428 | 445 | | |
429 | 446 | | |
430 | 447 | | |
| |||
447 | 464 | | |
448 | 465 | | |
449 | 466 | | |
450 | | - | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
451 | 474 | | |
452 | | - | |
453 | | - | |
454 | | - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
455 | 482 | | |
456 | 483 | | |
457 | 484 | | |
| |||
473 | 500 | | |
474 | 501 | | |
475 | 502 | | |
476 | | - | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
477 | 518 | | |
478 | 519 | | |
479 | 520 | | |
480 | 521 | | |
481 | | - | |
| 522 | + | |
482 | 523 | | |
483 | 524 | | |
484 | 525 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
62 | 66 | | |
63 | | - | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 226 | + | |
| 227 | + | |
233 | 228 | | |
234 | 229 | | |
235 | 230 | | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
243 | 237 | | |
244 | 238 | | |
245 | 239 | | |
246 | | - | |
| 240 | + | |
247 | 241 | | |
248 | 242 | | |
249 | 243 | | |
| |||
0 commit comments