fix: render nested schema types in table Schema panel#236
Conversation
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>
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughTableColumnProfiler.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. ChangesSchema-aware profiler and detail dialogs
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()
Related Issues: None provided. Related PRs: None provided. Suggested labels: enhancement, ui Suggested reviewers: None provided. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/components/TableDetails.vue (1)
620-639: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse generated Iceberg types instead of
anyfor schema type data.
typeLabel(t: any)andschemaViewData = ref<any>(null)bypass the project's generated Iceberg types even though this data is literally the field/schema shape fromTableMetadata. Typing these against the generatedSchema/Type/StructField(or similar) types fromgen/iceberg/types.gen.tswould 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.tsandgen/management/types.gen.tsfiles".🤖 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 winReuse
currentSchemainstead of re-deriving the current schema.
schemaTreereimplements the exact schema-selection logic already defined incurrentSchema(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 fromcurrentSchemato 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
📒 Files selected for processing (2)
src/components/TableColumnProfiler.vuesrc/components/TableDetails.vue
Summary
Complex columns (struct/list/map) were vanishing from the table Schema panel — only scalar columns like
idshowed. The panel was built from a primitives-only filter that doubled as the schema display.Changes
struct/list/mapfields expand to their children; compact per-level type labels (array<struct>,map<string, array<struct>>).View JSONbutton 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.typeLabelin the schema-evolution popup is now recursive (was showing barestruct/list/map).Test
Created
t_primitives,t_struct,t_list,t_map,t_complexvia 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
Bug Fixes