From b7e618f088540a45e2ddab39696ce3d543821763 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sun, 18 Aug 2024 10:42:53 +0900 Subject: [PATCH] GH-43738: [GLib] Add `GArrowAzureFileSytem` (#43739) ### 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: #43738 Authored-by: Sutou Kouhei Signed-off-by: Sutou Kouhei --- c_glib/arrow-glib/file-system.cpp | 16 ++++++++++++++++ c_glib/arrow-glib/file-system.h | 12 ++++++++++++ 2 files changed, 28 insertions(+) diff --git a/c_glib/arrow-glib/file-system.cpp b/c_glib/arrow-glib/file-system.cpp index b6efa2b872635..9ba494e405957 100644 --- a/c_glib/arrow-glib/file-system.cpp +++ b/c_glib/arrow-glib/file-system.cpp @@ -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 */ @@ -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 * @@ -1592,6 +1606,8 @@ garrow_file_system_new_raw(std::shared_ptr *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; } diff --git a/c_glib/arrow-glib/file-system.h b/c_glib/arrow-glib/file-system.h index 2e500672e145c..9a903c6af68cf 100644 --- a/c_glib/arrow-glib/file-system.h +++ b/c_glib/arrow-glib/file-system.h @@ -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