Commit 24207e2
[SPARK-54834][SQL] Add new interfaces SimpleProcedure and SimpleFunction
### What changes were proposed in this pull request?
It's common that a procedure does not have any overload and the `bind` method always return the same `BoundProcedure`. This PR adds a new interface `SimpleProcedure ` for this use case, which allows people to implement a `BoundProcedure` directly without thinking about how to bind. The same applies to v2 functions.
### Why are the changes needed?
Simplify a common use case when people implement procedures and functions.
### Does this PR introduce _any_ user-facing change?
No, it's developer facing
### How was this patch tested?
new tests
### Was this patch authored or co-authored using generative AI tooling?
cursor 2.2.43
Closes #53595 from cloud-fan/procedure.
Authored-by: Wenchen Fan <wenchen@databricks.com>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>1 parent 76c9516 commit 24207e2
4 files changed
Lines changed: 119 additions & 4 deletions
File tree
- sql
- catalyst/src/main/java/org/apache/spark/sql/connector/catalog
- functions
- procedures
- core/src/test/scala/org/apache/spark/sql/connector
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
702 | 702 | | |
703 | 703 | | |
704 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
705 | 724 | | |
706 | 725 | | |
707 | 726 | | |
| |||
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
489 | 495 | | |
490 | 496 | | |
491 | 497 | | |
| |||
610 | 616 | | |
611 | 617 | | |
612 | 618 | | |
613 | | - | |
| 619 | + | |
614 | 620 | | |
615 | 621 | | |
616 | 622 | | |
| |||
633 | 639 | | |
634 | 640 | | |
635 | 641 | | |
636 | | - | |
| 642 | + | |
637 | 643 | | |
638 | 644 | | |
639 | | - | |
| 645 | + | |
640 | 646 | | |
641 | 647 | | |
642 | 648 | | |
| |||
897 | 903 | | |
898 | 904 | | |
899 | 905 | | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
900 | 912 | | |
0 commit comments