Commit a83d162
committed
fix: string_to_array('', delim) returns empty array for PostgreSQL compatibility
Rust's str::split() on an empty string always yields one empty-string
element, so "".split(",") produces [""]. The empty-delimiter branch
also unconditionally appended the (empty) string value. Both cases
now guard with !string.is_empty() to return a truly empty array,
matching PostgreSQL behavior.
Tests use cardinality() to unambiguously verify the result since
Arrow's text format renders [""] identically to [].1 parent 15bc6bd commit a83d162
2 files changed
Lines changed: 44 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
741 | | - | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
742 | 744 | | |
743 | 745 | | |
744 | 746 | | |
745 | | - | |
746 | | - | |
747 | | - | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
748 | 752 | | |
749 | 753 | | |
750 | 754 | | |
| |||
753 | 757 | | |
754 | 758 | | |
755 | 759 | | |
756 | | - | |
| 760 | + | |
757 | 761 | | |
758 | 762 | | |
759 | 763 | | |
| |||
765 | 769 | | |
766 | 770 | | |
767 | 771 | | |
768 | | - | |
769 | | - | |
770 | | - | |
771 | | - | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
772 | 778 | | |
773 | 779 | | |
774 | 780 | | |
775 | 781 | | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
783 | 791 | | |
784 | 792 | | |
785 | 793 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8623 | 8623 | | |
8624 | 8624 | | |
8625 | 8625 | | |
| 8626 | + | |
| 8627 | + | |
| 8628 | + | |
| 8629 | + | |
| 8630 | + | |
| 8631 | + | |
| 8632 | + | |
| 8633 | + | |
| 8634 | + | |
| 8635 | + | |
| 8636 | + | |
| 8637 | + | |
| 8638 | + | |
| 8639 | + | |
| 8640 | + | |
| 8641 | + | |
| 8642 | + | |
| 8643 | + | |
| 8644 | + | |
| 8645 | + | |
8626 | 8646 | | |
8627 | 8647 | | |
8628 | 8648 | | |
| |||
0 commit comments