From 62493358594fec55ecdd006bce0948a39e4ce466 Mon Sep 17 00:00:00 2001 From: Bingyi Sun Date: Fri, 14 Mar 2025 16:56:08 +0800 Subject: [PATCH] fix: Catch invalid json pointer error (#40625) issue: #35528 Signed-off-by: sunby --- internal/core/src/index/JsonInvertedIndex.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/internal/core/src/index/JsonInvertedIndex.cpp b/internal/core/src/index/JsonInvertedIndex.cpp index f396e09474..5cbaca22e7 100644 --- a/internal/core/src/index/JsonInvertedIndex.cpp +++ b/internal/core/src/index/JsonInvertedIndex.cpp @@ -46,10 +46,19 @@ JsonInvertedIndex::build_index_for_json( value_result res = json_column->at(nested_path_); auto err = res.error(); if (err != simdjson::SUCCESS) { - AssertInfo(err == simdjson::INCORRECT_TYPE || - err == simdjson::NO_SUCH_FIELD, - "Failed to parse json, err: {}", - err); + AssertInfo( + err == simdjson::INCORRECT_TYPE || + err == simdjson::NO_SUCH_FIELD || + err == simdjson::INVALID_JSON_POINTER, + "Failed to parse json, err: {}, json: {}, pointer: {}", + err, + *json_column, + nested_path_); + if (err == simdjson::INVALID_JSON_POINTER) { + LOG_WARN("Invalid json pointer, json: {}, pointer: {}", + *json_column, + nested_path_); + } { folly::SharedMutex::WriteHolder lock(this->mutex_); this->null_offset_.push_back(i);