Expand one array element (at path `element_path`, e.g., "poses[0]") into ColumnDescriptors. Handles: struct element (recurse into children), primitive/enum element (single column).
| 106 | // Expand one array element (at path `element_path`, e.g., "poses[0]") into ColumnDescriptors. |
| 107 | // Handles: struct element (recurse into children), primitive/enum element (single column). |
| 108 | void flattenArrayElementImpl( |
| 109 | const TypeTreeNode& element_type, std::string_view element_path, FieldId& next_field_id, |
| 110 | std::vector<ColumnDescriptor>& out) { |
| 111 | if (element_type.kind == TypeKind::kStruct) { |
| 112 | for (const auto& child : element_type.children) { |
| 113 | flattenColumnsImpl(*child, element_path, next_field_id, out); |
| 114 | } |
| 115 | } else { |
| 116 | ColumnDescriptor desc; |
| 117 | desc.field_id = next_field_id++; |
| 118 | desc.field_path = std::string(element_path); |
| 119 | desc.logical_type = element_type.primitive_type.value_or(PrimitiveType::kFloat64); |
| 120 | out.push_back(std::move(desc)); |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | /// Recursively flatten a type tree into ColumnDescriptors, collecting both |
| 125 | /// field paths and PrimitiveTypes for each leaf node. |
no test coverage detected