Repository navigation
Commit a7ef23f
committed
branch-4.1: [fix](iceberg) keep identity partition values of old specs after evolving to unpartitioned #68124
Cherry-picked from #68124. branch-4.1 has no fe-connector modules, so the same
fix is applied to the legacy IcebergScanNode instead of IcebergScanPlanProvider,
and it needs one branch-4.1-only addition (see below).
When a table's default partition spec evolves to unpartitioned, split planning
gated the per-file partition metadata on `icebergTable.spec().isPartitioned()`,
so data files written under an older identity spec no longer carried their
partition values. Gate on whether ANY spec of the table is partitioned instead;
the values, spec id and partition data are already computed from the spec each
data file was written with, which is what Iceberg's PartitionUtil.constantsMap
does.
That alone does not fix the read on this branch. Unlike master, which classifies
the identity columns of ALL specs as partition keys, branch-4.1 keys the
classification off the columns COMMON to every spec, which is empty once the
default spec is unpartitioned. BE then never applies the split value: the v2
column mapper uses a partition constant only for a column FE marked as a
partition key. So for scanner v2 the classification now uses the same all-specs
list as master. Files that carry no value for such a column are unaffected — the
v2 mapper falls back to the physical field. Scanner v1 keeps the common-columns
list: it has no such per-file fallback, so widening it there would turn files
that currently read the column from the file into NULLs.
Behavior change, same as master: a file that has neither a split partition value
nor the physical column now fails with "does not have a matching partition
value" instead of reading NULL.
The scanned-partition count keeps its previous meaning: partitionMapInfos now
also collects the partitions of old-spec files because it doubles as the
identity-value cache, so selectedPartitionNum / numApproximateSplits go through
scannedPartitionNum(), which reports nothing unless the CURRENT spec is
partitioned.1 parent 9f181d9 commit a7ef23f
4 files changed
Lines changed: 148 additions & 12 deletions
File tree
- fe/fe-core/src
- main/java/org/apache/doris/datasource/iceberg
- source
- test/java/org/apache/doris/datasource/iceberg
- source
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
982 | 982 | | |
983 | 983 | | |
984 | 984 | | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
985 | 999 | | |
986 | 1000 | | |
987 | 1001 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
202 | 205 | | |
203 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
204 | 211 | | |
205 | 212 | | |
206 | 213 | | |
| |||
318 | 325 | | |
319 | 326 | | |
320 | 327 | | |
| 328 | + | |
321 | 329 | | |
322 | 330 | | |
323 | 331 | | |
| |||
510 | 518 | | |
511 | 519 | | |
512 | 520 | | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | 521 | | |
518 | | - | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
519 | 529 | | |
520 | 530 | | |
521 | 531 | | |
522 | 532 | | |
523 | | - | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
524 | 539 | | |
| 540 | + | |
525 | 541 | | |
526 | 542 | | |
527 | 543 | | |
| |||
2611 | 2627 | | |
2612 | 2628 | | |
2613 | 2629 | | |
2614 | | - | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
2615 | 2634 | | |
2616 | 2635 | | |
2617 | 2636 | | |
| |||
2626 | 2645 | | |
2627 | 2646 | | |
2628 | 2647 | | |
2629 | | - | |
| 2648 | + | |
2630 | 2649 | | |
2631 | 2650 | | |
2632 | 2651 | | |
| |||
2639 | 2658 | | |
2640 | 2659 | | |
2641 | 2660 | | |
2642 | | - | |
| 2661 | + | |
2643 | 2662 | | |
2644 | 2663 | | |
2645 | 2664 | | |
| |||
2808 | 2827 | | |
2809 | 2828 | | |
2810 | 2829 | | |
2811 | | - | |
| 2830 | + | |
2812 | 2831 | | |
2813 | 2832 | | |
2814 | 2833 | | |
| |||
2845 | 2864 | | |
2846 | 2865 | | |
2847 | 2866 | | |
2848 | | - | |
| 2867 | + | |
2849 | 2868 | | |
2850 | 2869 | | |
2851 | 2870 | | |
| |||
3228 | 3247 | | |
3229 | 3248 | | |
3230 | 3249 | | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
3231 | 3261 | | |
3232 | 3262 | | |
3233 | | - | |
| 3263 | + | |
| 3264 | + | |
3234 | 3265 | | |
3235 | 3266 | | |
3236 | 3267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
430 | 449 | | |
431 | 450 | | |
432 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1816 | 1816 | | |
1817 | 1817 | | |
1818 | 1818 | | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
1819 | 1881 | | |
1820 | 1882 | | |
1821 | 1883 | | |
| |||
1950 | 2012 | | |
1951 | 2013 | | |
1952 | 2014 | | |
| 2015 | + | |
1953 | 2016 | | |
1954 | 2017 | | |
1955 | 2018 | | |
| |||
2035 | 2098 | | |
2036 | 2099 | | |
2037 | 2100 | | |
| 2101 | + | |
2038 | 2102 | | |
2039 | 2103 | | |
2040 | 2104 | | |
| |||
2173 | 2237 | | |
2174 | 2238 | | |
2175 | 2239 | | |
| 2240 | + | |
2176 | 2241 | | |
2177 | 2242 | | |
2178 | 2243 | | |
| |||
4013 | 4078 | | |
4014 | 4079 | | |
4015 | 4080 | | |
| 4081 | + | |
| 4082 | + | |
| 4083 | + | |
| 4084 | + | |
| 4085 | + | |
| 4086 | + | |
| 4087 | + | |
4016 | 4088 | | |
4017 | 4089 | | |
4018 | 4090 | | |
| |||
0 commit comments