Joe McDonnell has uploaded this change for review. ( https://gerrit.cloudera.org/25429
Change subject: IMPALA-15799: Fix codegen crash on struct member predicates on NULL tuples ...................................................................... IMPALA-15799: Fix codegen crash on struct member predicates on NULL tuples SlotRef::Init hard-coded tuple_is_nullable_ to false for slots whose parent is a struct-children tuple (added by IMPALA-11416 to fix an uninitialised read). For these slots tuple_idx_ is the index of the master tuple, which can be NULL, e.g. on the nullable side of an outer join. Codegen trusts tuple_is_nullable_: it omitted the tuple NULL check in CodegenNullChecking, allowed CanCodegenBranchFree (which reads the null indicator straight from the tuple pointer), and used a codegen'd function cache key that did not distinguish nullable tuples. A predicate on a struct member evaluated on a row with a NULL tuple, such as an unmatched build row of a right outer join, then dereferenced NULL and crashed impalad. The interpreted path always checks for a NULL tuple, so the query only crashed with codegen enabled. Set tuple_is_nullable_ from the row descriptor for struct children too. Add regression tests to struct-in-select-list.test with predicates on STRING and INT struct members in right outer joins. They crash impalad without the fix. The struct must also be in the select list, otherwise its members are not placed in a separate struct tuple. Testing: - Ran test_nested_types.py (all pass), including the new queries with codegen enabled and disabled on parquet and orc. - Verified manually that full outer joins with the struct on either side give identical results with codegen on and off. Change-Id: If7257ddf9b883e996ff2ce625e690b922b12cbad Assisted-by: Claude Sonnet 5.5 (Claude Code) --- M be/src/exprs/slot-ref.cc M testdata/workloads/functional-query/queries/QueryTest/struct-in-select-list.test 2 files changed, 42 insertions(+), 2 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/29/25429/1 -- To view, visit https://gerrit.cloudera.org/25429 To unsubscribe, visit https://gerrit.cloudera.org/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If7257ddf9b883e996ff2ce625e690b922b12cbad Gerrit-Change-Number: 25429 Gerrit-PatchSet: 1 Gerrit-Owner: Joe McDonnell <[email protected]>
