Commit def7919
authored
feat!: error on surplus columns in output schema (#1488)
## What changes are proposed in this pull request?
Fixes [#1248](#1248)
by adding field count validation to Struct expression evaluation,
preventing silent data loss when the expression produces fewer fields
than the output schema expects.
The validation exposed a bug (test `test_append_partitioned` in
`kernel/tests/write.rs` started failing) in partitioned table writes
where the full logical schema (with partition columns) was incorrectly
used instead of the physical schema (without partition columns), which
is fixed by adding a `physical_schema` field to `WriteContext` that
properly excludes partition columns.
## How was this change tested?
Added addional test case `test_struct_expression_schema_validation` in
`kernel/src/engine/arrow_expression/evaluate_expression.rs::944`
---------
Co-authored-by: aleksandarskrbic <aleksandarskrbic@users.noreply.github.com>1 parent aa23fd0 commit def7919
File tree
4 files changed
+123
-7
lines changed- ffi/src/transaction
- kernel/src
- engine
- arrow_expression
- default
- transaction
4 files changed
+123
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
105 | 113 | | |
106 | 114 | | |
107 | 115 | | |
| |||
931 | 939 | | |
932 | 940 | | |
933 | 941 | | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
934 | 985 | | |
935 | 986 | | |
936 | 987 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
560 | 573 | | |
561 | 574 | | |
562 | 575 | | |
| 576 | + | |
563 | 577 | | |
564 | 578 | | |
565 | 579 | | |
| |||
874 | 888 | | |
875 | 889 | | |
876 | 890 | | |
877 | | - | |
| 891 | + | |
| 892 | + | |
878 | 893 | | |
879 | 894 | | |
880 | 895 | | |
881 | 896 | | |
882 | | - | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
883 | 903 | | |
884 | 904 | | |
885 | | - | |
| 905 | + | |
| 906 | + | |
886 | 907 | | |
887 | 908 | | |
888 | 909 | | |
| |||
891 | 912 | | |
892 | 913 | | |
893 | 914 | | |
894 | | - | |
895 | | - | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
896 | 921 | | |
897 | 922 | | |
898 | 923 | | |
| |||
1109 | 1134 | | |
1110 | 1135 | | |
1111 | 1136 | | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1112 | 1177 | | |
0 commit comments