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 77fe763ff..7727f845c 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 { /// \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 Returns a map of schema for this table @@ -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 Returns a LocationProvider for this table + Result> location_provider() const; + /// \brief Refresh the current table metadata virtual Status Refresh();