1616
1717#pragma once
1818
19+ #include < optional>
1920#include < string>
2021
22+ #include " paimon/result.h"
2123#include " paimon/type_fwd.h"
2224#include " paimon/visibility.h"
2325
@@ -27,18 +29,32 @@ namespace paimon {
2729class PAIMON_EXPORT Identifier {
2830 public:
2931 static const char kUnknownDatabase [];
32+ static const char kSystemTableSplitter [];
33+ static const char kSystemBranchPrefix [];
34+ static const char kDefaultMainBranch [];
3035
3136 explicit Identifier (const std::string& table);
3237 Identifier (const std::string& database, const std::string& table);
3338
3439 bool operator ==(const Identifier& other);
3540 const std::string& GetDatabaseName () const ;
3641 const std::string& GetTableName () const ;
42+ Result<std::string> GetDataTableName () const ;
43+ Result<std::optional<std::string>> GetBranchName () const ;
44+ Result<std::string> GetBranchNameOrDefault () const ;
45+ Result<std::optional<std::string>> GetSystemTableName () const ;
46+ Result<bool > IsSystemTable () const ;
3747 std::string ToString () const ;
3848
3949 private:
50+ Status SplitTableName () const ;
51+
4052 const std::string database_;
4153 const std::string table_;
54+ mutable bool parsed_ = false ;
55+ mutable std::string data_table_;
56+ mutable std::optional<std::string> branch_;
57+ mutable std::optional<std::string> system_table_;
4258};
4359
4460} // namespace paimon
0 commit comments