Merge pull request #25401 from taosdata/fix/TD-29562

Fix/td 29562
This commit is contained in:
Hongze Cheng 2024-04-19 13:57:19 +08:00 committed by GitHub
commit 69222543a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 62 additions and 55 deletions

View File

@ -67,6 +67,8 @@ uint8_t getDefaultEncode(uint8_t type) {
return TSDB_COLVAL_ENCODE_SIMPLE8B;
case TSDB_DATA_TYPE_MEDIUMBLOB:
case TSDB_DATA_TYPE_GEOMETRY:
return TSDB_COLVAL_ENCODE_DISABLED;
case TSDB_DATA_TYPE_MAX:
return TSDB_COLVAL_ENCODE_SIMPLE8B;
@ -365,7 +367,7 @@ int8_t validColEncode(uint8_t type, uint8_t l1) {
} else if (type >= TSDB_DATA_TYPE_FLOAT && type <= TSDB_DATA_TYPE_DOUBLE) {
return TSDB_COLVAL_ENCODE_DELTAD == l1 ? 1 : 0;
} else if ((type == TSDB_DATA_TYPE_VARCHAR || type == TSDB_DATA_TYPE_NCHAR) || type == TSDB_DATA_TYPE_JSON ||
type == TSDB_DATA_TYPE_VARBINARY || type == TSDB_DATA_TYPE_BINARY) {
type == TSDB_DATA_TYPE_VARBINARY || type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_GEOMETRY) {
return l1 == TSDB_COLVAL_ENCODE_DISABLED ? 1 : 0;
// if (l1 >= TSDB_COLVAL_ENCODE_NOCHANGE || l1 <= TSDB_COLVAL_ENCODE_DELTAD) {
// return 1;

View File

@ -149,17 +149,22 @@ int metaDecodeEntry(SDecoder *pCoder, SMetaEntry *pME) {
metaError("meta/entry: invalide table type: %" PRId8 " decode failed.", pME->type);
return -1;
}
if (pME->type == TSDB_SUPER_TABLE) {
if (TABLE_IS_COL_COMPRESSED(pME->flags)) {
if (meteDecodeColCmprEntry(pCoder, pME) < 0) return -1;
} else {
metatInitDefaultSColCmprWrapper(pCoder, &pME->colCmpr, &pME->stbEntry.schemaRow);
TABLE_SET_COL_COMPRESSED(pME->flags);
}
} else if (pME->type == TSDB_NORMAL_TABLE) {
if (!tDecodeIsEnd(pCoder)) {
uDebug("set type: %d, tableName:%s", pME->type, pME->name);
if (meteDecodeColCmprEntry(pCoder, pME) < 0) return -1;
TABLE_SET_COL_COMPRESSED(pME->flags);
} else {
uDebug("set default type: %d, tableName:%s", pME->type, pME->name);
if (pME->type == TSDB_SUPER_TABLE) {
metatInitDefaultSColCmprWrapper(pCoder, &pME->colCmpr, &pME->stbEntry.schemaRow);
} else if (pME->type == TSDB_NORMAL_TABLE) {
metatInitDefaultSColCmprWrapper(pCoder, &pME->colCmpr, &pME->ntbEntry.schemaRow);
}
TABLE_SET_COL_COMPRESSED(pME->flags);
}
tEndDecode(pCoder);

View File

@ -2652,7 +2652,7 @@ int32_t colCompressDebug(SHashObj *pColCmprObj) {
const char *l1str = columnEncodeStr(l1);
const char *l2str = columnCompressStr(l2);
const char *lvlstr = columnLevelStr(lvl);
metaInfo("colId: %d, encode:%s, compress:%s,level:%s", colId, l1str, l2str, lvlstr);
metaDebug("colId: %d, encode:%s, compress:%s,level:%s", colId, l1str, l2str, lvlstr);
}
return 0;
}