Skip to content

fix(search): recurse into nested columns for columnDescriptionStatus - #32173

Merged
sonika-shah merged 3 commits into
mainfrom
fix/column-description-status-nested
Aug 27, 2026
Merged

sonika-shah merged 3 commits into
mainfrom
fix/column-description-status-nested

Conversation

@sonika-shah

@sonika-shah sonika-shah commented Aug 27, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #32184

Problem

The columnDescriptionStatus field powering the Explore Column Description filter is computed by ColumnIndex.getColumnDescriptionStatus(), which only iterated the top-level columns and never descended into nested/struct children (col.getChildren()).

As a result, a table whose top-level columns are documented but whose nested struct fields are all undocumented was indexed as COMPLETE — so the filter reported it as fully documented even though every field inside the nested column had no description.

Both TableIndex and WorksheetIndex call this shared default method, so both were affected.

Fix

Walk the full column tree. A table/worksheet is COMPLETE only when every column at every depth has a description; the first column (top-level or nested) with an empty description makes it INCOMPLETE.

The traversal is done iteratively with an explicit Deque rather than recursion:

private boolean hasUndocumentedColumn(List<Column> columns) {
  boolean undocumented = false;
  Deque<Column> pending = new ArrayDeque<>();
  pushColumns(pending, columns);
  while (!pending.isEmpty() && !undocumented) {
    Column col = pending.pop();
    if (CommonUtil.nullOrEmpty(col.getDescription())) {
      undocumented = true;
    } else {
      pushColumns(pending, col.getChildren());
    }
  }
  return undocumented;
}

Why a Deque instead of recursion?

  • No StackOverflowError. Recursion uses one JVM call-stack frame per nesting level, so a pathologically deep column tree could overflow the stack. An explicit Deque keeps the traversal state on the heap, so it is safe at any depth — without imposing an artificial depth cap.
  • Correct, uncoupled semantics. We deliberately did not bound this by the search mappingDepthLimit. That limit exists for the paths that emit nested fields into the ES document (parseColumns, flattenColumns, SchemaFieldFlattener) so the doc doesn't exceed index.mapping.depth.limit. This method emits a single scalar keyword (adds no depth), so it should reflect the true documentation state of all columns.
  • Cheap at scale. The deque holds column references (~a few MB worst case for very wide tables), not copies — the column objects are already in memory. It runs at index time (not on the query/API path), is a single O(N) pass that early-exits at the first undocumented column, and sits next to parseColumns, which already walks the same tree. So there is no measurable impact on API latency or large-table indexing.

Testing

Regression tests in ColumnIndexLimitTest exercise the real ColumnIndex default method via a Table (no mocks):

  • columnDescriptionStatus_incomplete_when_nested_child_undocumented — documented struct parent + undocumented child ⇒ INCOMPLETE (fails without the fix: expected: <INCOMPLETE> but was: <COMPLETE>).
  • columnDescriptionStatus_complete_when_all_nested_documented — every column and nested child documented ⇒ COMPLETE.
  • columnDescriptionStatus_handles_deep_nesting_without_stack_overflow — a 20,000-level deep chain is fully traversed and detected without a StackOverflowError.

Full class green (Tests run: 9, Failures: 0).

Greptile Summary

The PR updates column-description status indexing to inspect nested column trees without recursive stack growth.

  • Traverses top-level and nested columns using an explicit deque.
  • Marks tables and worksheets incomplete when any nested column lacks a description.
  • Adds regression coverage for documented, undocumented, and deeply nested column trees.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/ColumnIndex.java Replaces top-level-only description checking with iterative traversal of the complete nested column tree.
openmetadata-service/src/test/java/org/openmetadata/service/search/indexes/ColumnIndexLimitTest.java Adds regression tests for nested documentation status and stack-safe handling of deeply nested columns.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Table or worksheet columns] --> B[Push columns onto deque]
  B --> C{Deque empty?}
  C -- Yes --> D[Status COMPLETE]
  C -- No --> E[Pop next column]
  E --> F{Description empty?}
  F -- Yes --> G[Status INCOMPLETE]
  F -- No --> H[Push child columns]
  H --> C
Loading

Reviews (3): Last reviewed commit: "fix(search): traverse nested columns ite..." | Re-trigger Greptile

getColumnDescriptionStatus() only iterated top-level columns and never
recursed into nested/struct children (col.getChildren()). A table whose
top-level columns were documented but whose nested struct fields were all
undocumented was indexed as COMPLETE, so the Explore "Column Description"
filter reported it as fully documented.

Recurse through the column tree so a table (or worksheet) is COMPLETE only
when every column at every depth has a description.
@sonika-shah
sonika-shah requested a review from a team as a code owner August 27, 2026 11:06
Copilot AI lite review requested due to automatic review settings August 27, 2026 11:06

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Aug 27, 2026
…limit

Honor SearchFieldLimits.getDepthLimit() in the recursive description-status
traversal, matching parseColumns in the same file. Columns beyond the
indexing depth limit are not indexed anyway, so they no longer affect the
computed status, and the recursion can no longer exceed the configured depth.
Copilot AI review requested due to automatic review settings August 27, 2026 11:14

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…nStatus

Replace the depth-limit-bounded recursion with an explicit-stack (Deque)
traversal. This evaluates every column at every depth (no cap, so the status
stays a true documentation-completeness signal) while making StackOverflowError
impossible regardless of nesting depth. The deque holds column references only
(a few MB at worst for very wide tables), not copies, so it is safe at scale.
Copilot AI review requested due to automatic review settings August 27, 2026 11:24

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Updates ColumnIndex.getColumnDescriptionStatus() to iteratively traverse nested struct children using an explicit deque, ensuring table and worksheet documentation status correctly accounts for all levels. No issues found.

✅ 1 resolved
✅ Edge Case: Description status ignores maxColumns cap unlike parseColumns

📄 openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/ColumnIndex.java:100-112
The new depth bound makes hasUndocumentedColumn consistent with parseColumns' depth limit, but parseColumns also stops indexing once flattenColumns.size() reaches limits.getMaxColumns(). hasUndocumentedColumn has no such cap, so a table whose only undocumented column falls beyond the maxColumns cutoff will be reported INCOMPLETE even though that column is never indexed — the same class of mismatch this PR set out to fix for depth. If full consistency with what is actually indexed is the goal, consider bounding the total columns visited by limits.getMaxColumns() as well; otherwise this is acceptable as-is.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonika-shah sonika-shah added the To release Will cherry-pick this PR into the release branch label Aug 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 29debf84d87aa34dd159c3a459525629f6c1b700 in Playwright run 33067245601, attempt 1.

✅ 939 passed · ❌ 0 failed · 🟡 3 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 53m 54s

⏱️ Max setup 5m 2s · max shard execution 16m 25s · max shard-job elapsed before upload 20m 55s · reporting 6s

🌐 206.95 requests/attempt · 2.39 app boots/UI scenario · 22.03% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 22.03% (convergence target: at most 15%).
  • Browser traffic was 206.95 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.39 per UI scenario (2312 boots / 967 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 160 0 0 0 0 0
🟡 Shard chromium-02 153 0 2 0 0 0
✅ Shard chromium-03 155 0 0 0 0 0
🟡 Shard chromium-04 151 0 1 0 0 0
✅ Shard chromium-05 132 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 33 0 0 0 0 0
✅ Shard import-export-01 7 0 0 0 0 0
✅ Shard ingestion-01 2 0 0 0 0 0
✅ Shard reindex-01 28 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 3 flaky test(s) (passed on retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard chromium-02, 1 retry)
  • Pages/Glossary.spec.ts › Glossary & terms creation for reviewer as team (shard chromium-02, 1 retry)
  • Flow/MetricListSearch.spec.ts › typing in the search box filters the metric list server-side (shard chromium-04, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@sonika-shah
sonika-shah added this pull request to the merge queue Aug 27, 2026
Merged via the queue into main with commit f211242 Aug 27, 2026
193 of 197 checks passed
@sonika-shah
sonika-shah deleted the fix/column-description-status-nested branch August 27, 2026 19:51
@github-actions

Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 1.13 branch.
Please cherry-pick the changes manually.
You can find more details here.

@github-actions

Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 2.0 branch.
Please cherry-pick the changes manually.
You can find more details here.

sonika-shah added a commit that referenced this pull request Aug 30, 2026
…32173) (#32203)

* fix(search): recurse into nested columns for columnDescriptionStatus

getColumnDescriptionStatus() only iterated top-level columns and never
recursed into nested/struct children (col.getChildren()). A table whose
top-level columns were documented but whose nested struct fields were all
undocumented was indexed as COMPLETE, so the Explore "Column Description"
filter reported it as fully documented.

Recurse through the column tree so a table (or worksheet) is COMPLETE only
when every column at every depth has a description.

* fix(search): bound nested columnDescriptionStatus recursion by depth limit

Honor SearchFieldLimits.getDepthLimit() in the recursive description-status
traversal, matching parseColumns in the same file. Columns beyond the
indexing depth limit are not indexed anyway, so they no longer affect the
computed status, and the recursion can no longer exceed the configured depth.

* fix(search): traverse nested columns iteratively for columnDescriptionStatus

Replace the depth-limit-bounded recursion with an explicit-stack (Deque)
traversal. This evaluates every column at every depth (no cap, so the status
stays a true documentation-completeness signal) while making StackOverflowError
impossible regardless of nesting depth. The deque holds column references only
(a few MB at worst for very wide tables), not copies, so it is safe at scale.

(cherry picked from commit f211242)
sonika-shah added a commit that referenced this pull request Sep 1, 2026
…32173) (#32202)

* fix(search): recurse into nested columns for columnDescriptionStatus

getColumnDescriptionStatus() only iterated top-level columns and never
recursed into nested/struct children (col.getChildren()). A table whose
top-level columns were documented but whose nested struct fields were all
undocumented was indexed as COMPLETE, so the Explore "Column Description"
filter reported it as fully documented.

Recurse through the column tree so a table (or worksheet) is COMPLETE only
when every column at every depth has a description.

* fix(search): bound nested columnDescriptionStatus recursion by depth limit

Honor SearchFieldLimits.getDepthLimit() in the recursive description-status
traversal, matching parseColumns in the same file. Columns beyond the
indexing depth limit are not indexed anyway, so they no longer affect the
computed status, and the recursion can no longer exceed the configured depth.

* fix(search): traverse nested columns iteratively for columnDescriptionStatus

Replace the depth-limit-bounded recursion with an explicit-stack (Deque)
traversal. This evaluates every column at every depth (no cap, so the status
stays a true documentation-completeness signal) while making StackOverflowError
impossible regardless of nesting depth. The deque holds column references only
(a few MB at worst for very wide tables), not copies, so it is safe at scale.

(cherry picked from commit f211242)

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

columnDescriptionStatus ignores nested/struct columns — reports COMPLETE despite undocumented children

3 participants