hiroyuki-sato commented on code in PR #46305: URL: https://github.com/apache/arrow/pull/46305#discussion_r2075475925
########## c_glib/arrow-glib/basic-data-type.cpp: ########## @@ -2267,6 +2271,73 @@ garrow_string_view_data_type_new(void) return data_type; } +G_DEFINE_TYPE(GArrowFixedShapeTensorDataType, + garrow_fixed_shape_tensor_data_type, + GARROW_TYPE_EXTENSION_DATA_TYPE) + +static void +garrow_fixed_shape_tensor_data_type_init(GArrowFixedShapeTensorDataType *object) +{ +} + +static void +garrow_fixed_shape_tensor_data_type_class_init(GArrowFixedShapeTensorDataTypeClass *klass) +{ +} + +/** + * garrow_fixed_shape_tensor_data_type_new: + * @value_type: A #GArrowDataType. + * @size: The length of `shape`. + * @psize: The length of `permutation`. + * @shape: (array length=size): shape. + * @permutation: (array length=psize): permutation. + * @dim_name: (array length=size): dim_names. + * @error: (nullable): Return location for a #GError or %NULL. + * + * Returns: The newly created fixed shape tensor data type. + */ +GArrowFixedShapeTensorDataType * +garrow_fixed_shape_tensor_data_type_new(GArrowDataType *value_type, + gint32 size, + gint32 psize, + const gint64 *shape, + const gint64 *permutation, + const gchar **dim_name, + GError **error) +{ + std::vector<int64_t> arrow_shape; + std::vector<int64_t> arrow_permutation; + std::vector<std::string> arrow_dim_names; + + auto arrow_value_type = garrow_data_type_get_raw(value_type); + + for (int i = 0; i < psize; i++) { + arrow_shape.push_back(permutation[i]); Review Comment: Thanks Fixed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org