Skip to content

Commit e7e7e11

Browse files
committed
feat: expose interface for
1 parent 2bd493c commit e7e7e11

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/iceberg/table.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <memory>
2323

2424
#include "iceberg/catalog.h"
25+
#include "iceberg/location_provider.h"
2526
#include "iceberg/partition_spec.h"
2627
#include "iceberg/result.h"
2728
#include "iceberg/schema.h"
@@ -140,6 +141,10 @@ const std::shared_ptr<TableMetadata>& Table::metadata() const { return metadata_
140141

141142
const std::shared_ptr<Catalog>& Table::catalog() const { return catalog_; }
142143

144+
Result<std::unique_ptr<LocationProvider>> Table::location_provider() const {
145+
return LocationProvider::Make(metadata_->location, metadata_->properties);
146+
}
147+
143148
Result<std::unique_ptr<TableScanBuilder>> Table::NewScan() const {
144149
return TableScanBuilder::Make(metadata_, io_);
145150
}

src/iceberg/table.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ class ICEBERG_EXPORT Table : public std::enable_shared_from_this<Table> {
116116
/// \brief Returns the catalog that this table belongs to
117117
const std::shared_ptr<Catalog>& catalog() const;
118118

119+
/// \brief Return a LocationProvider for this table
120+
Result<std::unique_ptr<LocationProvider>> location_provider() const;
121+
119122
/// \brief Refresh the current table metadata
120123
virtual Status Refresh();
121124

0 commit comments

Comments
 (0)