]> git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/c_glib/arrow-glib/schema.h
25519000bb0faa4075bafa278d9c7485455ba553
[ceph.git] / ceph / src / arrow / c_glib / arrow-glib / schema.h
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20 #pragma once
21
22 #include <arrow-glib/field.h>
23
24 G_BEGIN_DECLS
25
26 #define GARROW_TYPE_SCHEMA (garrow_schema_get_type())
27 G_DECLARE_DERIVABLE_TYPE(GArrowSchema,
28 garrow_schema,
29 GARROW,
30 SCHEMA,
31 GObject)
32 struct _GArrowSchemaClass
33 {
34 GObjectClass parent_class;
35 };
36
37 GARROW_AVAILABLE_IN_6_0
38 GArrowSchema *
39 garrow_schema_import(gpointer c_abi_schema,
40 GError **error);
41
42 GArrowSchema *garrow_schema_new (GList *fields);
43
44 GARROW_AVAILABLE_IN_6_0
45 gpointer
46 garrow_schema_export(GArrowSchema *schema,
47 GError **error);
48
49 gboolean garrow_schema_equal (GArrowSchema *schema,
50 GArrowSchema *other_schema);
51 GArrowField *garrow_schema_get_field (GArrowSchema *schema,
52 guint i);
53 GArrowField *garrow_schema_get_field_by_name(GArrowSchema *schema,
54 const gchar *name);
55 GARROW_AVAILABLE_IN_0_15
56 gint garrow_schema_get_field_index (GArrowSchema *schema,
57 const gchar *name);
58
59 guint garrow_schema_n_fields (GArrowSchema *schema);
60 GList *garrow_schema_get_fields (GArrowSchema *schema);
61
62 gchar *garrow_schema_to_string(GArrowSchema *schema);
63 GARROW_AVAILABLE_IN_0_17
64 gchar *garrow_schema_to_string_metadata(GArrowSchema *schema,
65 gboolean show_metadata);
66
67 GArrowSchema *garrow_schema_add_field (GArrowSchema *schema,
68 guint i,
69 GArrowField *field,
70 GError **error);
71 GArrowSchema *garrow_schema_remove_field (GArrowSchema *schema,
72 guint i,
73 GError **error);
74 GArrowSchema *garrow_schema_replace_field (GArrowSchema *schema,
75 guint i,
76 GArrowField *field,
77 GError **error);
78
79 GARROW_AVAILABLE_IN_3_0
80 gboolean
81 garrow_schema_has_metadata(GArrowSchema *schema);
82 GARROW_AVAILABLE_IN_0_17
83 GHashTable *
84 garrow_schema_get_metadata(GArrowSchema *schema);
85 GARROW_AVAILABLE_IN_0_17
86 GArrowSchema *
87 garrow_schema_with_metadata(GArrowSchema *schema,
88 GHashTable *metadata);
89
90 G_END_DECLS