feat(inspect): Add base class for metadata table support#607
Conversation
wgtmac
left a comment
There was a problem hiding this comment.
Thanks for working on this! I've left some preliminary comments.
| class UpdateSortOrder; | ||
| class UpdateStatistics; | ||
|
|
||
| /// \brief Metadata tables. |
| /// | ||
| /// Once a table scan builder is created, it can be refined to project columns and | ||
| /// filter data. | ||
| Result<std::unique_ptr<TableScanBuilder>> NewScan() const; |
|
|
||
| std::shared_ptr<Table> source_table_; | ||
| std::string uuid_; | ||
| std::shared_ptr<Schema> schema_; |
There was a problem hiding this comment.
Member variables here and below are not necessary
| const std::string& uuid() const { return uuid_; } | ||
|
|
||
| /// \brief Returns the schema for this table, return NotFoundError if not found | ||
| Result<std::shared_ptr<Schema>> schema() const { return schema_; } |
There was a problem hiding this comment.
Let's remove these redefinitions here and below
| /// | ||
| /// \param table The source table | ||
| /// \return A SnapshotsTable exposing all snapshots or error status | ||
| static Result<std::unique_ptr<SnapshotsTable>> GetSnapshotsTable( |
There was a problem hiding this comment.
It looks cumbersome to use a function per type. Can we use enum metadata type or canonical metadata table name suffix instead to return a std::unique_ptr<Table> instead?
There was a problem hiding this comment.
BTW, do we want to support the case when users directly create a metadata table without having a table object? For example, users may directly create a metadata table from catalog by calling LoadTable and providing full table identifier with metadata table suffix.
This PR kicks off the implementation of table inspection support.
BaseMetadataTableclass (without scan support for now).MetadataTableFactoryas an entry point for creating metadata tables.SnapshotsTableandHistoryTableas example impl.