Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/iceberg/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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_);
}
Expand Down
5 changes: 4 additions & 1 deletion src/iceberg/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();

Expand Down
Loading