From 2f8620fa797da5f590fc83a4fc89760f22733195 Mon Sep 17 00:00:00 2001 From: zhagnlu <1542303831@qq.com> Date: Wed, 10 Sep 2025 10:33:57 +0800 Subject: [PATCH] fix: fix like failed and add max columns limit (#44233) #44137 Signed-off-by: luzhang Co-authored-by: luzhang --- internal/core/src/common/Consts.h | 6 ++++-- internal/core/src/exec/expression/UnaryExpr.cpp | 6 ++++-- internal/core/src/exec/expression/UnaryExpr.h | 6 +++--- pkg/util/paramtable/component_param.go | 7 +++++++ 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/internal/core/src/common/Consts.h b/internal/core/src/common/Consts.h index a0c7bec4f5..28225743c1 100644 --- a/internal/core/src/common/Consts.h +++ b/internal/core/src/common/Consts.h @@ -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"; diff --git a/internal/core/src/exec/expression/UnaryExpr.cpp b/internal/core/src/exec/expression/UnaryExpr.cpp index 888864dda7..89082db6fb 100644 --- a/internal/core/src/exec/expression/UnaryExpr.cpp +++ b/internal/core/src/exec/expression/UnaryExpr.cpp @@ -1012,10 +1012,12 @@ PhyUnaryRangeFilterExpr::ExecRangeVisitorImplJsonByStats() { index->ExecutorForShreddingData( 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()); } }; diff --git a/internal/core/src/exec/expression/UnaryExpr.h b/internal/core/src/exec/expression/UnaryExpr.h index 46a9529d1c..e26e28e035 100644 --- a/internal/core/src/exec/expression/UnaryExpr.h +++ b/internal/core/src/exec/expression/UnaryExpr.h @@ -628,7 +628,7 @@ BatchUnaryCompare(const T* src, template class ShreddingExecutor { - using IndexInnerType = + using InnerType = std::conditional_t, std::string, GetType>; @@ -659,7 +659,7 @@ class ShreddingExecutor { private: void ExecuteOperation(const GetType* src, size_t size, TargetBitmapView res) { - BatchUnaryCompare(src, size, val_, op_type_, res); + BatchUnaryCompare(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_; }; diff --git a/pkg/util/paramtable/component_param.go b/pkg/util/paramtable/component_param.go index 8b69e7cddd..e6af7e5dc4 100644 --- a/pkg/util/paramtable/component_param.go +++ b/pkg/util/paramtable/component_param.go @@ -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)