Impala Public Jenkins has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/22508 )

Change subject: IMPALA-13770: Updating Iceberg tables with UDFs crashes Impala
......................................................................

IMPALA-13770: Updating Iceberg tables with UDFs crashes Impala

When using a native UDF in the target value of an UPDATE statement or in
a filter predicate or target value of a MERGE statement, Impala crashes
with the following DCHECK:

  be/src/exprs/expr.cc:47 47 DCHECK(cache_entry_ == nullptr);

This DCHECK is in the destructor of Expr, and it fires because Close()
has not been called for the expression. In the UPDATE case this is
caused by MultiTableSinkConfig: it creates child DataSinkConfig objects
but does not call Close() on them, and consequently these child sink
configs do not call Close() on their output expressions.
In the MERGE case it is because various expressions are not closed in
IcebergMergeCase and IcebergMergeNode.

This patch fixes the issue by overriding Close() in MultiTableSinkConfig,
calling Close() on the child sinks as well as closing the expressions in
IcebergMergeCase and IcebergMergeNode.

Testing:
 - Added EE regression tests for the UPDATE and MERGE cases in
   iceberg-update-basic.test and iceberg-merge.test

Change-Id: Id86638c8d6d86062c68cc9d708ec9c7b0a4e95eb
Reviewed-on: http://gerrit.cloudera.org:8080/22508
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
M be/src/exec/iceberg-merge-node.cc
M be/src/exec/iceberg-merge-sink.cc
M be/src/exec/iceberg-merge-sink.h
M be/src/exec/multi-table-sink.cc
M be/src/exec/multi-table-sink.h
M testdata/workloads/functional-query/queries/QueryTest/iceberg-merge.test
M 
testdata/workloads/functional-query/queries/QueryTest/iceberg-update-basic.test
M tests/query_test/test_iceberg.py
8 files changed, 85 insertions(+), 4 deletions(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

--
To view, visit http://gerrit.cloudera.org:8080/22508
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id86638c8d6d86062c68cc9d708ec9c7b0a4e95eb
Gerrit-Change-Number: 22508
Gerrit-PatchSet: 9
Gerrit-Owner: Daniel Becker <[email protected]>
Gerrit-Reviewer: Daniel Becker <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Noemi Pap-Takacs <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>

Reply via email to