Skip to content

Commit

Permalink
apacheGH-43738: [GLib] Add GArrowAzureFileSytem (apache#43739)
Browse files Browse the repository at this point in the history
### Rationale for this change

The bindings for `arrow::fs::AzureFileSytem` is missing.

### What changes are included in this PR?

Add the bindings for `arrow::fs::AzureFileSytem`.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* GitHub Issue: apache#43738

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
kou authored Aug 18, 2024
1 parent fbac12c commit b7e618f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
16 changes: 16 additions & 0 deletions c_glib/arrow-glib/file-system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ G_BEGIN_DECLS
* #GArrowS3FileSystem is a class for S3-backed file system.
*
* #GArrowGCSFileSystem is a class for GCS-backed file system.
*
* #GArrowAzureFileSystem is a class for Azure-backed file system.
*/

/* arrow::fs::FileInfo */
Expand Down Expand Up @@ -1561,6 +1563,18 @@ garrow_gcs_file_system_class_init(GArrowGCSFileSystemClass *klass)
{
}

G_DEFINE_TYPE(GArrowAzureFileSystem, garrow_azure_file_system, GARROW_TYPE_FILE_SYSTEM)

static void
garrow_azure_file_system_init(GArrowAzureFileSystem *file_system)
{
}

static void
garrow_azure_file_system_class_init(GArrowAzureFileSystemClass *klass)
{
}

G_END_DECLS

GArrowFileInfo *
Expand Down Expand Up @@ -1592,6 +1606,8 @@ garrow_file_system_new_raw(std::shared_ptr<arrow::fs::FileSystem> *arrow_file_sy
file_system_type = GARROW_TYPE_S3_FILE_SYSTEM;
} else if (type_name == "gcs") {
file_system_type = GARROW_TYPE_GCS_FILE_SYSTEM;
} else if (type_name == "abfs") {
file_system_type = GARROW_TYPE_AZURE_FILE_SYSTEM;
} else if (type_name == "mock") {
file_system_type = GARROW_TYPE_MOCK_FILE_SYSTEM;
}
Expand Down
12 changes: 12 additions & 0 deletions c_glib/arrow-glib/file-system.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,4 +337,16 @@ struct _GArrowGCSFileSystemClass
GArrowFileSystemClass parent_class;
};

#define GARROW_TYPE_AZURE_FILE_SYSTEM (garrow_azure_file_system_get_type())
GARROW_AVAILABLE_IN_18_0
G_DECLARE_DERIVABLE_TYPE(GArrowAzureFileSystem,
garrow_azure_file_system,
GARROW,
AZURE_FILE_SYSTEM,
GArrowFileSystem)
struct _GArrowAzureFileSystemClass
{
GArrowFileSystemClass parent_class;
};

G_END_DECLS

0 comments on commit b7e618f

Please sign in to comment.