Skip to content

branch-4.1: [fix](iceberg) Fix planning failure for Iceberg Variant subpaths - #68121

Merged
yiguolei merged 1 commit into
apache:branch-4.1from
hubgeter:fix/iceberg-variant-access-path-branch-4.1
Sep 17, 2026
Merged

yiguolei merged 1 commit into
apache:branch-4.1from
hubgeter:fix/iceberg-variant-access-path-branch-4.1

Conversation

@hubgeter

@hubgeter hubgeter commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary:

Querying a subpath of an Iceberg VARIANT column fails during planning when enable_prune_nested_column is enabled (the default):

SELECT CAST(message['mainDomain'] AS STRING) FROM iceberg_tbl;
-- ERROR 1105 (HY000): errCode = 2, detailMessage = Iceberg access path continues below primitive column message

IcebergScanNode walks projected access paths when checking backend compatibility and treats every path component as an Iceberg schema child. Variant object keys are data, so the walk fails on them. This PR stops the walk at Variant columns after checking the Variant field itself.

Master is not affected.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hubgeter
hubgeter requested a review from yiguolei as a code owner September 17, 2026 06:23
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hubgeter
hubgeter force-pushed the fix/iceberg-variant-access-path-branch-4.1 branch from 814d0a7 to c69263a Compare September 17, 2026 06:48
@hubgeter

Copy link
Copy Markdown
Contributor Author

run buildall

@hubgeter

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static-only review at exact head c69263a against base 3a33142.

Opinion: approve; I found no blocking correctness issue.

The new VARIANT terminal is placed after the current Iceberg field requirement is checked, so Variant-relative keys are no longer interpreted as schema IDs or collection/meta tokens while ancestor and field-level checks remain intact. I traced all three consumers of this walker: recursive initial-default materialization, missing-required-field rejection, and name/alias collision gating during smooth upgrades. Multiple paths, sibling projections, STRUCT/ARRAY/MAP parents, reserved-looking keys, and numeric-key collisions preserve the existing compatibility fences.

The unit and regression additions cover top-level and nested Variant paths, mixed shredded/unshredded Parquet, historical nested defaults, explicit NULL, filtering/grouping, pruning-on/off parity, and a Spark cross-reader comparison. The generated fixture and expected rows are internally consistent.

Critical checkpoints: correctness and rolling-upgrade compatibility passed static inspection; no lifecycle, configuration, performance, test-validity, or duplicate-comment concern was found. No extra user focus was supplied. Per the review contract I did not run builds or tests, so this is static-only rather than runtime validation.

Review convergence: the main scan plus the normal full reviewer and both risk-focused reviewers completed Round 1 with no valuable findings and no unresolved candidates.

…ubpaths

Querying a subpath of an Iceberg VARIANT column fails during planning
when nested column pruning is enabled, which is the default:

    SELECT CAST(message['mainDomain'] AS STRING) FROM iceberg_tbl;
    ERROR 1105 (HY000): errCode = 2, detailMessage = Iceberg access path
    continues below primitive column message

IcebergScanNode walks projected access paths when checking backend
compatibility and treats every component as an Iceberg schema child.
Variant object keys are data, and a Variant column has no schema
children, so the walk fails on them. Stop the walk at Variant columns
after checking the Variant field itself.
@hubgeter
hubgeter force-pushed the fix/iceberg-variant-access-path-branch-4.1 branch from c69263a to 817910e Compare September 17, 2026 07:40
@hubgeter

Copy link
Copy Markdown
Contributor Author

run buildall

@hubgeter

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static-only review at exact head 817910e1ae47a36708e9c710309bfbeaf4cefa70 against base 3a33142dc3ff59126d1270d4f0ebab69ac069525.

Opinion: approve; I found no blocking or material correctness issue.

Critical checkpoints:

  • Correctness and schema semantics: the new stop occurs only after the current Iceberg field requirement is evaluated. Iceberg VARIANT is a schema leaf, so encoded object keys, array indexes, numeric strings, and reserved-looking tokens are correctly excluded from further Iceberg field traversal without hiding the VARIANT field or its ancestors.
  • Compatibility and rolling upgrade: I traced recursive initial-default detection, historical missing-required-field rejection, and name-mapping collision fencing. Their field/ancestor checks remain intact, and the independent effective-VARIANT backend gate still rejects smooth-upgrade source backends.
  • Tests: the unit coverage exercises top-level and nested VARIANT paths, token/field-ID ambiguity, collection traversal, and required-field history. The regression forces nested pruning and covers root, STRUCT, MAP, ARRAY, projection, grouping, and filtering with internally consistent expected rows.
  • Review context: no inline comments required deduplication, and no additional user-provided focus was supplied.

Review convergence completed in Round 1: two normal full-review assignments and the separate risk-focused review all returned NO_NEW_VALUABLE_FINDINGS; the main review independently verified their evidence and resolved every risk with no candidate findings.

Per the review contract, I did not run builds or tests or modify repository source. This is a static-only opinion, not runtime validation.

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (2/2) 🎉
Increment coverage report
Complete coverage report

@yiguolei
yiguolei merged commit 4714241 into apache:branch-4.1 Sep 17, 2026
29 of 30 checks passed
@yiguolei yiguolei mentioned this pull request Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants