Commit bf959c3
[BUG FIX] Iceberg: fix Missing required field for newly-added nested MAP/LIST
When an Iceberg table evolves via ALTER TABLE ... ADD COLUMN with a nested
optional MAP/LIST and a pre-evolution data file is read, the GPU post-
processor used to throw `IllegalArgumentException: Missing required field`
before the missing container's own handler could emit FillNull. Iceberg's
SchemaWithPartnerVisitor walks post-order, so primitive children of a missing
container are visited first; a required descendant (map key is intrinsically
required, list elements may be required) was dispatched to
MissingFieldActionBuilder.buildAction with isOptional=false and threw.
Track each field's partner type on the ActionBuildingVisitor's field stack
and expose a strict-ancestor `isInsideMissingContainer` flag (excludes the
current field itself, so the missing container's own struct/list/map handler
still runs the regular partner==null logic). Treat the new flag exactly like
the existing `isInsideConstantStruct` short-circuit in the four
partner==null branches: descendants of a missing container fall through to
FillNull (which the parent's own FillNull discards anyway).
Adds three regression tests covering:
- nested optional MAP<STRING, BIGINT> missing from file (the reproducer)
- nested optional LIST<required element> missing from file
- doubly-nested missing struct containing a missing map (exercises the
strict-ancestor logic across multiple levels)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Chong Gao <res_life@163.com>1 parent a9f7a35 commit bf959c3
2 files changed
Lines changed: 153 additions & 10 deletions
File tree
- iceberg/common/src/main/scala/com/nvidia/spark/rapids/iceberg/parquet
- tests/src/test/spark350/scala/com/nvidia/spark/rapids/iceberg
Lines changed: 26 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
400 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
401 | 404 | | |
402 | 405 | | |
403 | 406 | | |
404 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
405 | 416 | | |
406 | 417 | | |
407 | 418 | | |
| |||
424 | 435 | | |
425 | 436 | | |
426 | 437 | | |
427 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
428 | 443 | | |
429 | 444 | | |
430 | 445 | | |
| |||
463 | 478 | | |
464 | 479 | | |
465 | 480 | | |
466 | | - | |
| 481 | + | |
467 | 482 | | |
468 | 483 | | |
469 | 484 | | |
| |||
484 | 499 | | |
485 | 500 | | |
486 | 501 | | |
487 | | - | |
| 502 | + | |
488 | 503 | | |
489 | 504 | | |
490 | 505 | | |
| |||
493 | 508 | | |
494 | 509 | | |
495 | 510 | | |
496 | | - | |
| 511 | + | |
497 | 512 | | |
498 | 513 | | |
499 | 514 | | |
| |||
508 | 523 | | |
509 | 524 | | |
510 | 525 | | |
511 | | - | |
| 526 | + | |
512 | 527 | | |
513 | 528 | | |
514 | 529 | | |
| |||
517 | 532 | | |
518 | 533 | | |
519 | 534 | | |
520 | | - | |
| 535 | + | |
521 | 536 | | |
522 | 537 | | |
523 | 538 | | |
| |||
538 | 553 | | |
539 | 554 | | |
540 | 555 | | |
541 | | - | |
| 556 | + | |
| 557 | + | |
542 | 558 | | |
543 | 559 | | |
544 | 560 | | |
| |||
Lines changed: 127 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 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 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
938 | 1065 | | |
0 commit comments