Commit 1ed2141
[BUG FIX] Iceberg: fix Missing required field for newly-added nested MAP/LIST (#14880)
Fixes #14879.
### Description
When an Iceberg table evolves via `ALTER TABLE ... ADD COLUMN` with a
nested optional `MAP` or `LIST`, and a pre-evolution data file is read
on GPU, `GpuParquetReaderPostProcessor` used to throw
`IllegalArgumentException: Missing required field` before the missing
container's own `map()`/`list()` handler could emit `FillNull`. The CPU
reader handles this case correctly; the GPU read fails.
**User experience after this change:** queries against Iceberg tables
that have schema-evolved to add a nested `MAP`/`LIST` now succeed
end-to-end on GPU; pre-evolution rows materialize the new column as
`NULL`, matching CPU behavior. No new configs or user-facing knobs.
**Technical fix:** 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 at `GpuParquetReaderPostProcessor.scala:385` before the
container's own handler ran.
The fix extends `ActionBuildingVisitor`'s field stack to track each
field's partner type and adds a strict-ancestor
`isInsideMissingContainer` flag (excludes the current field itself, so
the missing container's own `struct`/`list`/`map` handler still runs the
normal `partner == null` logic). The new flag is treated 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).
**Tests added** (`GpuPostProcessorSuite`):
- `Missing nested optional map with required key does not throw` — the
reproducer; verifies both action-plan construction and `process()`
execution
- `Missing nested optional list with required element does not throw`
- `Doubly nested missing container with required descendant does not
throw` — exercises the strict-ancestor logic across multiple levels
All 15 `GpuPostProcessorSuite` tests pass under buildver=356.
### Checklists
Documentation
- [ ] Updated for new or modified user-facing features or behaviors
- [x] No user-facing change
Testing
- [x] Added or modified tests to cover new code paths
- [ ] Covered by existing tests
- [ ] Not required
Performance
- [ ] Tests ran and results are added in the PR description
- [ ] Issue filed with a link in the PR description
- [x] Not required
---------
Signed-off-by: Chong Gao <res_life@163.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent ba38a05 commit 1ed2141
2 files changed
Lines changed: 179 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: 153 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 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
938 | 1091 | | |
0 commit comments