From e7e7e11418823aed6eb6c488c2978f50256b719a Mon Sep 17 00:00:00 2001 From: Zhuo Wang Date: Mon, 12 Jan 2026 15:50:48 +0800 Subject: [PATCH 1/2] feat: expose interface for --- src/iceberg/table.cc | 5 +++++ src/iceberg/table.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/iceberg/table.cc b/src/iceberg/table.cc index f2e6d3202..f5aacd824 100644 --- a/src/iceberg/table.cc +++ b/src/iceberg/table.cc @@ -22,6 +22,7 @@ #include #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& Table::metadata() const { return metadata_ const std::shared_ptr& Table::catalog() const { return catalog_; } +Result> Table::location_provider() const { + return LocationProvider::Make(metadata_->location, metadata_->properties); +} + Result> Table::NewScan() const { return TableScanBuilder::Make(metadata_, io_); } diff --git a/src/iceberg/table.h b/src/iceberg/table.h index 311395856..c16718191 100644 --- a/src/iceberg/table.h +++ b/src/iceberg/table.h @@ -116,6 +116,9 @@ class ICEBERG_EXPORT Table : public std::enable_shared_from_this { /// \brief Returns the catalog that this table belongs to const std::shared_ptr& catalog() const; + /// \brief Return a LocationProvider for this table + Result> location_provider() const; + /// \brief Refresh the current table metadata virtual Status Refresh(); From fab1da21f741533326528b9f2daee9fb21271baa Mon Sep 17 00:00:00 2001 From: Zhuo Wang Date: Mon, 12 Jan 2026 19:47:46 +0800 Subject: [PATCH 2/2] docs: change Return to Returns in Table API comments --- src/iceberg/table.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/iceberg/table.h b/src/iceberg/table.h index c16718191..067376624 100644 --- a/src/iceberg/table.h +++ b/src/iceberg/table.h @@ -50,49 +50,49 @@ class ICEBERG_EXPORT Table : public std::enable_shared_from_this
{ virtual ~Table(); - /// \brief Return the identifier of this table + /// \brief Returns the identifier of this table const TableIdentifier& name() const { return identifier_; } /// \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> schema() const; - /// \brief Return a map of schema for this table + /// \brief Returns a map of schema for this table Result< std::reference_wrapper>>> schemas() const; - /// \brief Return the partition spec for this table, return NotFoundError if not found + /// \brief Returns the partition spec for this table, return NotFoundError if not found Result> spec() const; - /// \brief Return a map of partition specs for this table + /// \brief Returns a map of partition specs for this table Result>>> specs() const; - /// \brief Return the sort order for this table, return NotFoundError if not found + /// \brief Returns the sort order for this table, return NotFoundError if not found Result> sort_order() const; - /// \brief Return a map of sort order IDs to sort orders for this table + /// \brief Returns a map of sort order IDs to sort orders for this table Result>>> sort_orders() const; - /// \brief Return a map of string properties for this table + /// \brief Returns a map of string properties for this table const TableProperties& properties() const; - /// \brief Return the table's metadata file location + /// \brief Returns the table's metadata file location std::string_view metadata_file_location() const; - /// \brief Return the table's base location + /// \brief Returns the table's base location std::string_view location() const; /// \brief Returns the time when this table was last updated TimePointMs last_updated_ms() const; - /// \brief Return the table's current snapshot, return NotFoundError if not found + /// \brief Returns the table's current snapshot, return NotFoundError if not found Result> current_snapshot() const; /// \brief Get the snapshot of this table with the given id @@ -116,7 +116,7 @@ class ICEBERG_EXPORT Table : public std::enable_shared_from_this
{ /// \brief Returns the catalog that this table belongs to const std::shared_ptr& catalog() const; - /// \brief Return a LocationProvider for this table + /// \brief Returns a LocationProvider for this table Result> location_provider() const; /// \brief Refresh the current table metadata