[fix](parquet) fix null pointer dereference in gen_filter_map when filter_all is true#63889
Open
Larborator wants to merge 1 commit into
Open
[fix](parquet) fix null pointer dereference in gen_filter_map when filter_all is true#63889Larborator wants to merge 1 commit into
Larborator wants to merge 1 commit into
Conversation
…lter_all is true When FilterMap is initialized with filter_all=true (via init(nullptr, total_rows, true)), _has_filter is true but _filter_map_data is nullptr. The gen_filter_map function dereferences filter_map_data() without null check, causing SIGSEGV when reading nested columns (e.g. struct fields) from Paimon external tables during lazy read with predicates that filter out all rows. Fix: skip gen_filter_map when filter_all() is true, and instead propagate the filter_all semantics to the nested filter map directly.
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
/review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: close #63887
Problem Summary:
Fix null pointer dereference (SIGSEGV) in
ScalarColumnReader::gen_filter_mapwhen reading nested type columns (Struct/Array/Map) from Parquet-based external tables.When a predicate filters out all rows in a RowGroup,
FilterMapis initialized withfilter_all=trueand_filter_map_data=nullptr. The_read_nested_columnfunction only checkshas_filter()before callinggen_filter_map, which dereferencesfilter_map_data()unconditionally — causing a crash.Fix: add a
filter_all()check before callinggen_filter_map. Whenfilter_allis true, directly construct an all-zero nested filter map withfilter_all=truepropagation. This is logically equivalent to whatgen_filter_mapwould produce with valid all-zero filter data — both correctly discard all data from the RowGroup.Release note
Fix BE crash (SIGSEGV) when querying Parquet-based external tables (Paimon/Hive/Iceberg) with nested type columns under lazy read, if predicates filter out all rows in a RowGroup.
Check List (For Author)
Manual test: Verified with standalone program simulating
gen_filter_maplogic — crashes without fix, passes with fix.Unit test: Added
test_filter_all_nullptr_nested_filter_mapandtest_all_zero_filter_nested_filter_mapinparquet_common_test.cpp.Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)