mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
fix: [2.5] Json Stats filter the data is double but the filter expr is int (#40771)
Json Stats filter the data is double but the filter is int issue: https://github.com/milvus-io/milvus/issues/40707 master-pr:https://github.com/milvus-io/milvus/pull/38039 Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
This commit is contained in:
parent
cd8d7efc96
commit
2710eb3fc9
@ -532,26 +532,34 @@ PhyBinaryRangeFilterExpr::ExecRangeVisitorImplForJsonForIndex() {
|
||||
} while (false)
|
||||
#define BinaryRangeJSONTypeCompare(cmp) \
|
||||
do { \
|
||||
if (type == uint8_t(milvus::index::JSONType::STRING)) { \
|
||||
if constexpr (std::is_same_v<GetType, std::string_view>) { \
|
||||
if constexpr (std::is_same_v<GetType, std::string_view>) { \
|
||||
if (type == uint8_t(milvus::index::JSONType::STRING)) { \
|
||||
auto val = json.at_string(offset, size); \
|
||||
return (cmp); \
|
||||
} else { \
|
||||
return false; \
|
||||
} \
|
||||
} else if (type == uint8_t(milvus::index::JSONType::DOUBLE)) { \
|
||||
if constexpr (std::is_same_v<GetType, double>) { \
|
||||
} else if constexpr (std::is_same_v<GetType, double>) { \
|
||||
if (type == uint8_t(milvus::index::JSONType::INT64)) { \
|
||||
auto val = \
|
||||
std::stoll(std::string(json.at_string(offset, size))); \
|
||||
return (cmp); \
|
||||
} else if (type == uint8_t(milvus::index::JSONType::DOUBLE)) { \
|
||||
auto val = \
|
||||
std::stod(std::string(json.at_string(offset, size))); \
|
||||
return (cmp); \
|
||||
} else { \
|
||||
return false; \
|
||||
} \
|
||||
} else if (type == uint8_t(milvus::index::JSONType::INT64)) { \
|
||||
if constexpr (std::is_same_v<GetType, int64_t>) { \
|
||||
} else if constexpr (std::is_same_v<GetType, int64_t>) { \
|
||||
if (type == uint8_t(milvus::index::JSONType::INT64)) { \
|
||||
auto val = \
|
||||
std::stoll(std::string(json.at_string(offset, size))); \
|
||||
return (cmp); \
|
||||
} else if (type == uint8_t(milvus::index::JSONType::DOUBLE)) { \
|
||||
auto val = \
|
||||
std::stod(std::string(json.at_string(offset, size))); \
|
||||
return (cmp); \
|
||||
} else { \
|
||||
return false; \
|
||||
} \
|
||||
|
||||
@ -946,25 +946,32 @@ PhyUnaryRangeFilterExpr::ExecRangeVisitorImplJsonForIndex() {
|
||||
|
||||
#define UnaryJSONTypeCompare(cmp) \
|
||||
do { \
|
||||
if (type == uint8_t(milvus::index::JSONType::STRING)) { \
|
||||
if constexpr (std::is_same_v<GetType, std::string_view>) { \
|
||||
if constexpr (std::is_same_v<GetType, std::string_view>) { \
|
||||
if (type == uint8_t(milvus::index::JSONType::STRING)) { \
|
||||
auto x = json.at_string(offset, size); \
|
||||
return (cmp); \
|
||||
} else { \
|
||||
return false; \
|
||||
} \
|
||||
} else if (type == uint8_t(milvus::index::JSONType::DOUBLE)) { \
|
||||
if constexpr (std::is_same_v<GetType, double>) { \
|
||||
} else if constexpr (std::is_same_v<GetType, double>) { \
|
||||
if (type == uint8_t(milvus::index::JSONType::INT64)) { \
|
||||
auto x = \
|
||||
std::stoll(std::string(json.at_string(offset, size))); \
|
||||
return (cmp); \
|
||||
} else if (type == uint8_t(milvus::index::JSONType::DOUBLE)) { \
|
||||
auto x = std::stod(std::string(json.at_string(offset, size))); \
|
||||
return (cmp); \
|
||||
} else { \
|
||||
return false; \
|
||||
} \
|
||||
} else if (type == uint8_t(milvus::index::JSONType::INT64)) { \
|
||||
if constexpr (std::is_same_v<GetType, int64_t>) { \
|
||||
} else if constexpr (std::is_same_v<GetType, int64_t>) { \
|
||||
if (type == uint8_t(milvus::index::JSONType::INT64)) { \
|
||||
auto x = \
|
||||
std::stoll(std::string(json.at_string(offset, size))); \
|
||||
return (cmp); \
|
||||
} else if (type == uint8_t(milvus::index::JSONType::DOUBLE)) { \
|
||||
auto x = std::stod(std::string(json.at_string(offset, size))); \
|
||||
return (cmp); \
|
||||
} else { \
|
||||
return false; \
|
||||
} \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user