PDGGK commented on PR #9532: URL: https://github.com/apache/paimon/pull/9532#issuecomment-5502651730
Both P2s confirmed and fixed in `20d2ec77` — I reproduced each of them against an unmodified build first. **Width budget.** With `maxSchemaWidth = 8`, `r` came out `ROW<value BYTES, typed_value BIGINT>`, so the second column did get to spend what the carried-forward `ROW<x BIGINT>` was holding. The branch now walks the retained schema instead of returning it. **Exhaustion semantics.** Your second point was right about my first attempt: it decremented before its guard, so the field that consumed the final unit was dropped rather than kept with a `VARIANT` child. With `maxSchemaWidth = 7` and your rounds, `b` came back as an untyped root and lost `q`. It now enters a child only while budget remains, spends the unit on entry, and downgrades an exhausted child to `VARIANT` with its field or array container intact — the same shape as the loop in `finalizeAdaptiveSchema`. Three controls, so each test is pinned to the thing it covers rather than to the crash: | source | what fails | |---|---| | `master` | both retention tests error with the `IllegalStateException` | | early return, no debiting | only `testRetainedSchemaStillConsumesTheSharedWidthBudget`, as an assertion failure | | decrement before the guard | only `testRetainedSchemaKeepsItsFieldsAtTheLastBudgetUnit` | `mvn test -pl paimon-common -Dtest='org.apache.paimon.data.variant.**'` — 54 tests, and `-pl paimon-format -Dtest=InferVariantShreddingWriteTest` — 18 tests, all passing. `spotless:check` and `checkstyle:check` clean. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
