wgtmac commented on code in PR #47:
URL: https://github.com/apache/iceberg-cpp/pull/47#discussion_r2007076713


##########
src/iceberg/table.h:
##########
@@ -19,17 +19,91 @@
 
 #pragma once
 
+#include <map>
 #include <string>
+#include <vector>
 
+#include "iceberg/expected.h"
 #include "iceberg/iceberg_export.h"
+#include "iceberg/type_fwd.h"
 
 namespace iceberg {
 
-/// \brief The metadata of an Iceberg table.
+/// \brief Represents an Iceberg table
 class ICEBERG_EXPORT Table {
  public:
   virtual ~Table() = default;
-  virtual std::string print() const = 0;
+
+  /// \brief Return the full name for this table
+  virtual std::string name() const = 0;
+
+  /// \brief Returns the UUID of the table
+  virtual std::string uuid() const = 0;
+
+  /// \brief Refresh the current table metadata
+  virtual void Refresh() = 0;
+
+  /// \brief Return the schema for this table
+  virtual const std::shared_ptr<Schema>& schema() const = 0;
+
+  /// \brief Return a map of schema for this table
+  virtual std::map<int32_t, std::shared_ptr<Schema>> schemas() const = 0;
+
+  /// \brief Return the partition spec for this table
+  virtual const std::shared_ptr<PartitionSpec>& spec() const = 0;
+
+  /// \brief Return a map of partition specs for this table
+  virtual std::map<int32_t, std::shared_ptr<PartitionSpec>> specs() const = 0;
+
+  /// \brief Return the sort order for this table
+  virtual const std::shared_ptr<SortOrder>& sort_order() const = 0;
+
+  /// \brief Return a map of sort order IDs to sort orders for this table
+  virtual std::map<int32_t, std::shared_ptr<SortOrder>> sort_orders() const = 
0;
+
+  /// \brief Return a map of string properties for this table
+  virtual std::map<std::string, std::string> properties() const = 0;
+
+  /// \brief Return the table's base location
+  virtual std::string location() const = 0;
+
+  /// \brief Return the table's current snapshot
+  virtual const std::shared_ptr<Snapshot>& current_snapshot() const = 0;
+
+  /// \brief Get the snapshot of this table with the given id, or null if 
there is no
+  /// matching snapshot
+  ///
+  /// \param snapshot_id the ID of the snapshot to get
+  /// \return the Snapshot with the given id
+  virtual expected<std::shared_ptr<Snapshot>, Error> snapshot(
+      int64_t snapshot_id) const = 0;
+
+  /// \brief Get the snapshots of this table
+  virtual std::vector<std::shared_ptr<Snapshot>> snapshots() const = 0;
+
+  /// \brief Get the snapshot history of this table
+  ///
+  /// \return a vector of history entries
+  virtual std::vector<std::shared_ptr<HistoryEntry>> history() const = 0;
+
+  /// \brief Create a new table scan for this table
+  ///
+  /// Once a table scan is created, it can be refined to project columns and 
filter data.
+  virtual std::shared_ptr<TableScan> NewScan() const = 0;
+
+  /// \brief Create a new append API to add files to this table and commit
+  virtual std::shared_ptr<AppendFiles> NewAppend() = 0;

Review Comment:
   I think I wrote TableScan to be in a std::unique_ptr (it might be changed by 
Cursor...)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to