fix: fix like failed and add max columns limit (#44233)

#44137

Signed-off-by: luzhang <luzhang@zilliz.com>
Co-authored-by: luzhang <luzhang@zilliz.com>
This commit is contained in:
zhagnlu 2025-09-10 10:33:57 +08:00 committed by GitHub
parent cc7a6d3ec6
commit 2f8620fa79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 7 deletions

View File

@ -64,8 +64,10 @@ constexpr const char* JSON_KEY_STATS_SHARED_FIELD_NAME = "__shared";
inline constexpr const char* JSON_STATS_META_KEY_LAYOUT_TYPE_MAP =
"key_layout_type_map";
// start json stats field id for mock column
const int64_t START_JSON_STATS_FIELD_ID = 1000;
const int64_t END_JSON_STATS_FIELD_ID = 10000;
// max user field id is 1024, so start json stats field id from 2000
// new field numbers will not exceed 10000 fields
const int64_t START_JSON_STATS_FIELD_ID = 2000;
const int64_t END_JSON_STATS_FIELD_ID = 12000;
const char DEFAULT_PLANNODE_ID[] = "0";
const char DEAFULT_QUERY_ID[] = "0";

View File

@ -1012,10 +1012,12 @@ PhyUnaryRangeFilterExpr::ExecRangeVisitorImplJsonByStats() {
index->ExecutorForShreddingData<ColType>(
target_field, executor, nullptr, res_view, valid_res_view);
LOG_DEBUG(
"using shredding data's field: {} with value {}, count {}",
"using shredding data's field: {} with value {}, count {} "
"for segment {}",
target_field,
val,
res_view.count());
res_view.count(),
segment_->get_segment_id());
}
};

View File

@ -628,7 +628,7 @@ BatchUnaryCompare(const T* src,
template <typename GetType, typename ValType>
class ShreddingExecutor {
using IndexInnerType =
using InnerType =
std::conditional_t<std::is_same_v<GetType, std::string_view>,
std::string,
GetType>;
@ -659,7 +659,7 @@ class ShreddingExecutor {
private:
void
ExecuteOperation(const GetType* src, size_t size, TargetBitmapView res) {
BatchUnaryCompare<GetType, ValType>(src, size, val_, op_type_, res);
BatchUnaryCompare<GetType, InnerType>(src, size, val_, op_type_, res);
}
void
@ -677,7 +677,7 @@ class ShreddingExecutor {
}
proto::plan::OpType op_type_;
ValType val_;
InnerType val_;
std::string pointer_;
};

View File

@ -5424,6 +5424,13 @@ if param targetVecIndexVersion is not set, the default value is -1, which means
DefaultValue: "1024",
Doc: "the max number of columns to shred",
Export: true,
Formatter: func(value string) string {
v := getAsInt(value)
if v > 10000 {
return "10000"
}
return strconv.Itoa(v)
},
}
p.JSONStatsMaxShreddingColumns.Init(base.mgr)