This is an automated email from the ASF dual-hosted git repository.

gangwu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new 08e81272 feat: expose  `location_provider` to `Table` (#506)
08e81272 is described below

commit 08e8127284afef6f76e5b57a813c5f20eb3cad09
Author: wzhuo <[email protected]>
AuthorDate: Tue Jan 13 17:26:50 2026 +0800

    feat: expose  `location_provider` to `Table` (#506)
---
 src/iceberg/table.cc | 5 +++++
 src/iceberg/table.h  | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/iceberg/table.cc b/src/iceberg/table.cc
index f2e6d320..f5aacd82 100644
--- a/src/iceberg/table.cc
+++ b/src/iceberg/table.cc
@@ -22,6 +22,7 @@
 #include <memory>
 
 #include "iceberg/catalog.h"
+#include "iceberg/location_provider.h"
 #include "iceberg/partition_spec.h"
 #include "iceberg/result.h"
 #include "iceberg/schema.h"
@@ -140,6 +141,10 @@ const std::shared_ptr<TableMetadata>& Table::metadata() 
const { return metadata_
 
 const std::shared_ptr<Catalog>& Table::catalog() const { return catalog_; }
 
+Result<std::unique_ptr<LocationProvider>> Table::location_provider() const {
+  return LocationProvider::Make(metadata_->location, metadata_->properties);
+}
+
 Result<std::unique_ptr<TableScanBuilder>> Table::NewScan() const {
   return TableScanBuilder::Make(metadata_, io_);
 }
diff --git a/src/iceberg/table.h b/src/iceberg/table.h
index 77fe763f..7727f845 100644
--- a/src/iceberg/table.h
+++ b/src/iceberg/table.h
@@ -56,7 +56,7 @@ class ICEBERG_EXPORT Table : public 
std::enable_shared_from_this<Table> {
   /// \brief Returns the UUID of the table
   const std::string& uuid() const;
 
-  /// \brief Return the schema for this table, return NotFoundError if not 
found
+  /// \brief Returns the schema for this table, return NotFoundError if not 
found
   Result<std::shared_ptr<Schema>> schema() const;
 
   /// \brief Returns a map of schema for this table
@@ -116,6 +116,9 @@ class ICEBERG_EXPORT Table : public 
std::enable_shared_from_this<Table> {
   /// \brief Returns the catalog that this table belongs to
   const std::shared_ptr<Catalog>& catalog() const;
 
+  /// \brief Returns a LocationProvider for this table
+  Result<std::unique_ptr<LocationProvider>> location_provider() const;
+
   /// \brief Refresh the current table metadata
   virtual Status Refresh();
 

Reply via email to