提交 da065e31 编写于 作者: X Xiaoyu Wang

TD-11819 mock catalog function for parser ut

上级 0a9eb233
...@@ -162,7 +162,7 @@ public: ...@@ -162,7 +162,7 @@ public:
int16_t numOfFields = numOfTags + table.second->tableInfo.numOfColumns; int16_t numOfFields = numOfTags + table.second->tableInfo.numOfColumns;
for (int16_t i = 0; i < numOfFields; ++i) { for (int16_t i = 0; i < numOfFields; ++i) {
const SSchema* schema = table.second->schema + i; const SSchema* schema = table.second->schema + i;
std::cout << SF(std::string(schema->name)) << SH((i < numOfTags ? std::string("tag") : std::string("column"))) << SH(dtToString(schema->type)) << IF(schema->bytes) << std::endl; std::cout << SF(std::string(schema->name)) << SH(ftToString(i, numOfTags)) << SH(dtToString(schema->type)) << IF(schema->bytes) << std::endl;
} }
std::cout << std::endl; std::cout << std::endl;
} }
...@@ -203,6 +203,10 @@ private: ...@@ -203,6 +203,10 @@ private:
return tDataTypes[type].name; return tDataTypes[type].name;
} }
std::string ftToString(int16_t colid, int16_t numOfTags) const {
return (0 == colid ? "column" : (colid <= numOfTags ? "tag" : "column"));
}
std::shared_ptr<STableMeta> getTableMeta(const std::string& db, const std::string& tbname) const { std::shared_ptr<STableMeta> getTableMeta(const std::string& db, const std::string& tbname) const {
DbMetaCache::const_iterator it = meta_.find(db); DbMetaCache::const_iterator it = meta_.find(db);
if (meta_.end() == it) { if (meta_.end() == it) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册