Repository navigation
Commit 265473e
authored
## Which issue does this PR close?
* Part of #22163
## Rationale for this change
The `%c` conversion path in Spark `format_string` duplicated nearly
identical logic across all signed and unsigned integer scalar variants.
This duplication increased maintenance overhead and the risk of future
`%c` fixes being applied inconsistently.
This change centralizes numeric scalar-to-character conversion in a
single helper while preserving existing behavior and error propagation
semantics.
## What changes are included in this PR?
* Added a local `integer_scalar_to_char` helper to centralize integer
scalar `%c` conversion handling.
* Routed all non-null integer `%c` conversion paths through the new
helper.
* Removed duplicated `%c` conversion branches from individual integer
scalar match arms.
* Preserved existing signed/unsigned conversion semantics by continuing
to use the existing `signed_to_char` and `unsigned_to_char` helpers.
* Left all non-`%c` formatting behavior unchanged.
## Are these changes tested?
No new tests were added in this PR.
This refactor is intended to preserve existing behavior, and existing
`%c` formatting tests continue to validate valid and invalid code point
handling.
Suggested validation command:
```bash
cargo test -p datafusion-spark format_char
```
## Are there any user-facing changes?
No. This is a maintainability refactor only and is not intended to
change observable behavior or error messages.
## LLM-generated code disclosure
This PR includes LLM-generated code and comments. All LLM-generated
content has been manually reviewed and tested.
1 parent e80076b commit 265473e
1 file changed
Lines changed: 32 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
891 | 891 | | |
892 | 892 | | |
893 | 893 | | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
894 | 911 | | |
895 | 912 | | |
896 | 913 | | |
| |||
923 | 940 | | |
924 | 941 | | |
925 | 942 | | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
926 | 958 | | |
927 | 959 | | |
928 | 960 | | |
| |||
933 | 965 | | |
934 | 966 | | |
935 | 967 | | |
936 | | - | |
937 | | - | |
938 | | - | |
939 | 968 | | |
940 | 969 | | |
941 | 970 | | |
| |||
952 | 981 | | |
953 | 982 | | |
954 | 983 | | |
955 | | - | |
956 | | - | |
957 | | - | |
958 | 984 | | |
959 | 985 | | |
960 | 986 | | |
| |||
983 | 1009 | | |
984 | 1010 | | |
985 | 1011 | | |
986 | | - | |
987 | | - | |
988 | | - | |
989 | 1012 | | |
990 | 1013 | | |
991 | 1014 | | |
| |||
1008 | 1031 | | |
1009 | 1032 | | |
1010 | 1033 | | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
1014 | 1034 | | |
1015 | 1035 | | |
1016 | 1036 | | |
| |||
1031 | 1051 | | |
1032 | 1052 | | |
1033 | 1053 | | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | 1054 | | |
1038 | 1055 | | |
1039 | 1056 | | |
| |||
1054 | 1071 | | |
1055 | 1072 | | |
1056 | 1073 | | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
1060 | 1074 | | |
1061 | 1075 | | |
1062 | 1076 | | |
| |||
1077 | 1091 | | |
1078 | 1092 | | |
1079 | 1093 | | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | 1094 | | |
1084 | 1095 | | |
1085 | 1096 | | |
| |||
1100 | 1111 | | |
1101 | 1112 | | |
1102 | 1113 | | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | 1114 | | |
1107 | 1115 | | |
1108 | 1116 | | |
| |||
0 commit comments