Skip to content

fix: index field in list which has upper maps#158

Merged
wenchy merged 2 commits intomasterfrom
fix/index-list-in-map
Mar 30, 2026
Merged

fix: index field in list which has upper maps#158
wenchy merged 2 commits intomasterfrom
fix/index-list-in-map

Conversation

@wenchy
Copy link
Copy Markdown
Member

@wenchy wenchy commented Mar 28, 2026

Problem

When a list field has upper-level map containers, the index generation was not correctly handling the nested structure. The index key struct and lookup logic did not account for the map keys in the path from root to the indexed list field.

Solution

  • Updated the index descriptor to properly track and include upper map keys when building index paths for list fields nested inside maps.
  • Updated helper functions across all three language plugins (Go, C++, C#) to support the new nested map+list index structure.
  • Added new test cases in index_conf.proto and corresponding generated test files to cover this scenario.

Changes

  • internal/index/descriptor.go: Enhanced index descriptor to handle list fields with upper map containers.
  • cmd/protoc-gen-go-tableau-loader: Updated helper, index, and ordered_index generators.
  • cmd/protoc-gen-cpp-tableau-loader: Synced the same changes for C++ plugin.
  • cmd/protoc-gen-csharp-tableau-loader: Synced the same changes for C# plugin.
  • test/: Added new test proto definitions (Fruit5Conf, Fruit6Conf) and regenerated all loader code for Go, C++, and C#.

@wenchy wenchy merged commit a86e3b1 into master Mar 30, 2026
6 checks passed
@wenchy wenchy deleted the fix/index-list-in-map branch March 30, 2026 08:02
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.

2 participants