[BugFix] check if it's flatjson before non-existent field optimization (backport #62227) (#62241)

Co-authored-by: Murphy <96611012+murphyatwork@users.noreply.github.com>
This commit is contained in:
mergify[bot] 2025-08-23 09:04:53 +08:00 committed by GitHub
parent 34e3f8ca7b
commit cf71a82f85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -197,6 +197,7 @@ public:
const std::vector<std::unique_ptr<ColumnReader>>* sub_readers() const { return _sub_readers.get(); }
bool is_flat_json() const { return _is_flat_json; }
bool has_remain_json() const { return _has_remain; }
// Return the pointer to the remain filter if it exists, otherwise return nullptr.

View File

@ -533,7 +533,7 @@ StatusOr<ColumnIteratorUPtr> Segment::_new_extended_column_iterator(const Tablet
std::string_view leaf = paths.back();
may_contains = column_reader->get_remain_filter()->test_bytes(leaf.data(), leaf.size());
}
if (!may_contains) {
if (column_reader->is_flat_json() && !may_contains) {
// create an iterator always return NULL for fields that don't exist in this segment
auto default_null_iter = std::make_unique<DefaultValueColumnIterator>(false, "", true, get_type_info(column),
column.length(), num_rows());