* garrow_schema_new: * @fields: (element-type GArrowField): The fields of the schema. * * Returns: A newly created #GArrowSchema. */
| 152 | * Returns: A newly created #GArrowSchema. |
| 153 | */ |
| 154 | GArrowSchema * |
| 155 | garrow_schema_new(GList *fields) |
| 156 | { |
| 157 | std::vector<std::shared_ptr<arrow::Field>> arrow_fields; |
| 158 | for (GList *node = fields; node; node = node->next) { |
| 159 | GArrowField *field = GARROW_FIELD(node->data); |
| 160 | arrow_fields.push_back(garrow_field_get_raw(field)); |
| 161 | } |
| 162 | |
| 163 | auto arrow_schema = std::make_shared<arrow::Schema>(arrow_fields); |
| 164 | return garrow_schema_new_raw(&arrow_schema); |
| 165 | } |
| 166 | |
| 167 | /** |
| 168 | * garrow_schema_export: |
no test coverage detected