Skip to content

fix: render nested schema types in table Schema panel#236

Merged
v-kessler merged 2 commits into
mainfrom
fix/schema-nested-types
Jul 6, 2026
Merged

fix: render nested schema types in table Schema panel#236
v-kessler merged 2 commits into
mainfrom
fix/schema-nested-types

Conversation

@v-kessler

@v-kessler v-kessler commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Complex columns (struct/list/map) were vanishing from the table Schema panel — only scalar columns like id showed. The panel was built from a primitives-only filter that doubled as the schema display.

Changes

  • Show all columns as an inline expandable tree with connector lines (matches the warehouse navigation tree). Nested struct/list/map fields expand to their children; compact per-level type labels (array<struct>, map<string, array<struct>>).
  • Profiling (analyze + stats) is gated to top-level primitive columns; nested rows are structural.
  • JSON view: a View JSON button in the Schema panel header opens the raw schema; the Schema-evolution popup gets a Table / JSON toggle (one view at a time) with copy.
  • typeLabel in the schema-evolution popup is now recursive (was showing bare struct/list/map).

Test

Created t_primitives, t_struct, t_list, t_map, t_complex via Spark SQL and verified all columns render with full nested signatures and the JSON toggle works.

BEGIN_COMMIT_OVERRIDE
fix(ui): render nested struct/list/map columns in table Schema panel
feat(ui): add schema JSON view + Table/JSON toggle to schema popup
END_COMMIT_OVERRIDE

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a schema tree view in the profiler so nested fields can be expanded and collapsed.
    • Added a raw schema JSON dialog with a JSON/table toggle and a copy-to-clipboard action.
    • Improved schema labels to display nested field types more clearly.
  • Bug Fixes

    • Profiler stats now appear only for eligible top-level fields, while nested structural rows are shown without misleading metrics.
    • Updated table layout and spacing for better readability of complex schemas.

Complex columns (struct/list/map) were dropped because the Schema panel
was built from a primitives-only filter. Show all columns as an expandable
tree with connector lines, gate profiling to top-level primitives, and add
a JSON view (schema panel button + Table/JSON toggle in the schema-evolution
popup).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@v-kessler, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 25d9ad28-1ad8-471e-9f86-06162edf7d2b

📥 Commits

Reviewing files that changed from the base of the PR and between 8b4ec9a and b95854b.

📒 Files selected for processing (2)
  • src/components/TableColumnProfiler.vue
  • src/components/TableDetails.vue

Walkthrough

TableColumnProfiler.vue now models schema as a hierarchical tree with expand/collapse rows, conditional stats for profilable primitives, and a raw schema JSON dialog. TableDetails.vue's schema dialog gains a table/JSON view toggle rendering via vue-json-pretty, plus a recursive typeLabel formatter.

Changes

Schema-aware profiler and detail dialogs

Layer / File(s) Summary
Schema-tree modeling and derived state
src/components/TableColumnProfiler.vue
Adds shortType, childrenOf, makeNode, schemaTree, expanded/toggleExpand, visibleRows, and a primitiveColumns derived from the tree.
Profiler table rendering from schema tree
src/components/TableColumnProfiler.vue
Renders hierarchical rows from visibleRows with expand/collapse chevrons, conditional Analyze action, stats only for profilable primitives, and adjusts profiler table CSS.
Raw schema JSON dialog in profiler
src/components/TableColumnProfiler.vue
Adds a "View JSON" button, schemaJsonOpen state, currentSchema computed, copySchemaJson(), and a themed Schema JSON dialog.
TableDetails schema dialog table/JSON toggle
src/components/TableDetails.vue
Adds schemaViewMode state and a v-btn-toggle, widens the dialog, adds conditional Copy button, and reworks typeLabel to recursively format nested struct/list/map types.
TableDetails raw JSON rendering with vue-json-pretty
src/components/TableDetails.vue
Renders schema JSON via vue-json-pretty themed by useVisualStore, imports the library/CSS, and adds .schema-json scroll styling.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant TableColumnProfiler
  participant SchemaTree
  participant Clipboard

  User->>TableColumnProfiler: click "View JSON"
  TableColumnProfiler->>SchemaTree: read currentSchema
  TableColumnProfiler-->>User: open Schema JSON dialog
  User->>TableColumnProfiler: click Copy
  TableColumnProfiler->>Clipboard: copySchemaJson()
Loading

Related Issues: None provided.

Related PRs: None provided.

Suggested labels: enhancement, ui

Suggested reviewers: None provided.

Poem

A rabbit hops through fields of trees,
Expanding schemas with practiced ease,
JSON popups, copy with a click,
Nested structs formatted quick,
Hop hop hooray, the schema's clear! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: rendering nested schema types in the table Schema panel.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/schema-nested-types

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
src/components/TableDetails.vue (1)

620-639: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use generated Iceberg types instead of any for schema type data.

typeLabel(t: any) and schemaViewData = ref<any>(null) bypass the project's generated Iceberg types even though this data is literally the field/schema shape from TableMetadata. Typing these against the generated Schema/Type/StructField (or similar) types from gen/iceberg/types.gen.ts would give compile-time safety for the recursive struct/list/map handling introduced here.

♻️ Suggested typing improvement
-function typeLabel(t: any): string {
+function typeLabel(t: Schema['fields'][number]['type']): string {
   if (t == null) return '';
   if (typeof t === 'string') return t;
   if (typeof t === 'object') {
     if (t.type === 'struct') {
-      const inner = (t.fields ?? []).map((f: any) => `${f.name}: ${typeLabel(f.type)}`).join(', ');
+      const inner = (t.fields ?? []).map((f) => `${f.name}: ${typeLabel(f.type)}`).join(', ');
       return `struct<${inner}>`;
     }
     if (t.type === 'list') return `array<${typeLabel(t.element)}>`;
     if (t.type === 'map') return `map<${typeLabel(t.key)}, ${typeLabel(t.value)}>`;
     return t.type || 'complex';
   }
   return String(t);
 }

As per coding guidelines, "Iceberg and Management API types should be imported from auto-generated gen/iceberg/types.gen.ts and gen/management/types.gen.ts files".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/TableDetails.vue` around lines 620 - 639, Replace the `any`
usage in `typeLabel` and `schemaViewData` with the generated Iceberg schema
types from `gen/iceberg/types.gen.ts`. Update `typeLabel` to accept the
appropriate generated `Type`/`Schema`/`StructField` union so the recursive
struct/list/map handling is strongly typed, and type `schemaViewData` with the
matching schema shape instead of `ref<any>(null)`. Use the generated Iceberg
type symbols already available in the project to keep `TableDetails.vue` aligned
with the coding guidelines and preserve compile-time safety.

Source: Coding guidelines

src/components/TableColumnProfiler.vue (1)

594-597: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reuse currentSchema instead of re-deriving the current schema.

schemaTree reimplements the exact schema-selection logic already defined in currentSchema (Lines 327‑331). Two independent selectors can silently diverge if the resolution rule changes, causing the tree view and the JSON view to reflect different schemas. Derive the tree from currentSchema to keep them in lockstep.

♻️ Proposed refactor
 const schemaTree = computed<SchemaNode[]>(() => {
-  const schemas = props.metadata?.schemas ?? [];
-  const currentId = props.metadata?.['current-schema-id'];
-  const schema = schemas.find((s) => s['schema-id'] === currentId) ?? schemas[0];
-  return (schema?.fields ?? []).map((f) => {
+  return (currentSchema.value?.fields ?? []).map((f) => {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/TableColumnProfiler.vue` around lines 594 - 597, The schema
selection logic is duplicated in schemaTree instead of reusing currentSchema,
which can cause the tree and JSON views to drift apart. Update schemaTree in
TableColumnProfiler.vue to derive its data from currentSchema rather than
recomputing the current schema from props.metadata, so both views always use the
same resolved schema. Keep the change localized to the schemaTree computed and
reference currentSchema directly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/components/TableColumnProfiler.vue`:
- Around line 594-597: The schema selection logic is duplicated in schemaTree
instead of reusing currentSchema, which can cause the tree and JSON views to
drift apart. Update schemaTree in TableColumnProfiler.vue to derive its data
from currentSchema rather than recomputing the current schema from
props.metadata, so both views always use the same resolved schema. Keep the
change localized to the schemaTree computed and reference currentSchema
directly.

In `@src/components/TableDetails.vue`:
- Around line 620-639: Replace the `any` usage in `typeLabel` and
`schemaViewData` with the generated Iceberg schema types from
`gen/iceberg/types.gen.ts`. Update `typeLabel` to accept the appropriate
generated `Type`/`Schema`/`StructField` union so the recursive struct/list/map
handling is strongly typed, and type `schemaViewData` with the matching schema
shape instead of `ref<any>(null)`. Use the generated Iceberg type symbols
already available in the project to keep `TableDetails.vue` aligned with the
coding guidelines and preserve compile-time safety.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d6f6be12-2196-4dbf-a5cf-8eadec420429

📥 Commits

Reviewing files that changed from the base of the PR and between e18e09b and 8b4ec9a.

📒 Files selected for processing (2)
  • src/components/TableColumnProfiler.vue
  • src/components/TableDetails.vue

@v-kessler v-kessler merged commit 87728f3 into main Jul 6, 2026
5 checks passed
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.

1 participant