Merge pull request #9068 from taosdata/feature/3.0_wxy

TD-11819 mock catalog function for parser ut
This commit is contained in:
xiao-yu-wang 2021-12-13 18:03:06 +08:00 committed by GitHub
commit 6031721f46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -162,7 +162,7 @@ public:
int16_t numOfFields = numOfTags + table.second->tableInfo.numOfColumns;
for (int16_t i = 0; i < numOfFields; ++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;
}
@ -203,6 +203,10 @@ private:
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 {
DbMetaCache::const_iterator it = meta_.find(db);
if (meta_.end() == it) {