Skip to content

feat(catalog): enrich catalog interface with more methods#102

Open
ChaomingZhangCN wants to merge 10 commits intoalibaba:mainfrom
ChaomingZhangCN:catalog-api
Open

feat(catalog): enrich catalog interface with more methods#102
ChaomingZhangCN wants to merge 10 commits intoalibaba:mainfrom
ChaomingZhangCN:catalog-api

Conversation

@ChaomingZhangCN
Copy link
Contributor

@ChaomingZhangCN ChaomingZhangCN commented Feb 2, 2026

Purpose

Close #84

API and Format

virtual Status DropDatabase(const std::string& name, bool ignore_if_not_exists, bool cascade);
virtual Status AlterDatabase(const std::string& name, const std::map<std::string, std::string>& changes, bool ignore_if_not_exists);
virtual Result<std::shared_ptr<Database>> GetDatabase(const std::string& name) const;
virtual Result<std::shared_ptr<Table>> GetTable(const Identifier& identifier) const;
virtual Result<std::shared_ptr<Table>> GetTableById(const std::string& table_id) const;
virtual Status DropTable(const Identifier& identifier, bool ignore_if_not_exists);
virtual Status RenameTable(const Identifier& from_table, const Identifier& to_table, bool ignore_if_not_exists);
virtual Status MarkDonePartitions(const Identifier& identifier, const std::vector<std::map<std::string, std::string>>& partitions);
virtual Result<std::vector<std::map<std::string, std::string>>> ListPartitions(const Identifier& identifier) const;
virtual Status CreatePartitions(const Identifier& identifier, const std::vector<std::map<std::string, std::string>>& partitions);
virtual Status DropPartitions(const Identifier& identifier, const std::vector<std::map<std::string, std::string>>& partitions);
virtual Status AlterPartitions(const Identifier& identifier, const std::vector<PartitionStatistics>& partitions);
virtual Result<std::shared_ptr<View>> GetView(const Identifier& identifier) const;
virtual Status DropView(const Identifier& identifier, bool ignore_if_not_exists);
virtual Status CreateView(const Identifier& identifier, const View& view, bool ignore_if_exists);
virtual Result<std::vector<std::string>> ListViews(const std::string& database_name) const;
virtual Status RenameView(const Identifier& from_view, const Identifier& to_view, bool ignore_if_not_exists);
virtual Status RepairCatalog();
virtual Status RepairDatabase(const std::string& database_name);
virtual Status RepairTable(const Identifier& identifier);
virtual Status RegisterTable(const Identifier& identifier, const std::string& path);
virtual bool SupportsListObjectsPaged() const;
virtual bool SupportsListByPattern() const;
virtual bool SupportsListTableByType() const;
virtual bool SupportsVersionManagement() const;
virtual Result<bool> CommitSnapshot(const Identifier& identifier, const std::string& table_uuid, const std::shared_ptr<Snapshot>& snapshot, const std::vector<PartitionStatistics>& statistics);
virtual Result<std::shared_ptr<Snapshot>> LoadSnapshot(const Identifier& identifier, const std::string& version) const;
virtual Status RollbackTo(const Identifier& identifier, const std::chrono::system_clock::time_point& instant);
virtual Status RollbackTo(const Identifier& identifier, const std::chrono::system_clock::time_point& instant, const std::optional<int64_t>& from_snapshot);
virtual Status CreateBranch(const Identifier& identifier, const std::string& branch, const std::optional<std::string>& from_tag = std::nullopt);
virtual Status DropBranch(const Identifier& identifier, const std::string& branch);
virtual Status FastForward(const Identifier& identifier, const std::string& branch);
virtual Result<std::vector<std::string>> ListBranches(const Identifier& identifier) const;
virtual Result<TagInfo> GetTag(const Identifier& identifier, const std::string& tag_name) const;
virtual Status CreateTag(const Identifier& identifier, const std::string& tag_name, const std::optional<int64_t>& snapshot_id, const std::optional<std::string>& time_retained, bool ignore_if_exists);
virtual Status DeleteTag(const Identifier& identifier, const std::string& tag_name);

Documentation

@ChaomingZhangCN ChaomingZhangCN changed the title [feature] Enrich catalog interface with more methods feat: Enrich catalog interface with more methods Feb 2, 2026
@ChaomingZhangCN ChaomingZhangCN changed the title feat: Enrich catalog interface with more methods feat(catalog): Enrich catalog interface with more methods Feb 2, 2026
@ChaomingZhangCN ChaomingZhangCN changed the title feat(catalog): Enrich catalog interface with more methods feat(catalog): enrich catalog interface with more methods Feb 2, 2026
@ChaomingZhangCN
Copy link
Contributor Author

@lxy-9602 @lszskye PTAL~

/// Invalidates cached table metadata.
///
/// @param identifier Identifier of the table to invalidate.
virtual void InvalidateTable(const Identifier& identifier) {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does InvalidateTable need a return status?

/// @param instant Like snapshotId or tagName
/// @return A status indicating success or failure.
virtual Status RollbackTo(const Identifier& identifier,
const std::chrono::system_clock::time_point& instant) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instant is a time point or a snapshot id or tag name? It seems param mismatches comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement] Improve catalog interface

3 participants