You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by st...@apache.org on 2023/08/09 09:59:47 UTC

[impala] branch master updated: IMPALA-10829: Fix leak in KuduPartitionExpr::CloseEvaluator()

This is an automated email from the ASF dual-hosted git repository.

stigahuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


The following commit(s) were added to refs/heads/master by this push:
     new db478d4c5 IMPALA-10829: Fix leak in KuduPartitionExpr::CloseEvaluator()
db478d4c5 is described below

commit db478d4c522c55f7c849d617492a117b7700b6a7
Author: Csaba Ringhofer <cs...@cloudera.com>
AuthorDate: Tue Aug 8 15:51:06 2023 +0200

    IMPALA-10829: Fix leak in KuduPartitionExpr::CloseEvaluator()
    
    KuduPartitionExpr::CloseEvaluator() didn't call the base class's
    CloseEvaluator() which led to not closing its child expressions
    recursively.
    
    Testing:
    - added a regression test
    
    Change-Id: Ifcf35721e16ba780d01c19e916d58fb2e77a0836
    Reviewed-on: http://gerrit.cloudera.org:8080/20330
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/src/exprs/kudu-partition-expr.cc                           |  1 +
 .../functional-query/queries/QueryTest/kudu_insert.test       | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/be/src/exprs/kudu-partition-expr.cc b/be/src/exprs/kudu-partition-expr.cc
index 454c25159..ca6b6e0ca 100644
--- a/be/src/exprs/kudu-partition-expr.cc
+++ b/be/src/exprs/kudu-partition-expr.cc
@@ -83,6 +83,7 @@ void KuduPartitionExpr::CloseEvaluator(FunctionContext::FunctionStateScope scope
   // The destructor of KuduPartitionExprCtx handles all cleanup. Note that 'ctx' may be
   // NULL, in which case this is a no-op.
   delete ctx;
+  ScalarExpr::CloseEvaluator(scope, state, eval);
 }
 
 IntVal KuduPartitionExpr::GetIntValInterpreted(
diff --git a/testdata/workloads/functional-query/queries/QueryTest/kudu_insert.test b/testdata/workloads/functional-query/queries/QueryTest/kudu_insert.test
index 18423b744..ed09b3d61 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/kudu_insert.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/kudu_insert.test
@@ -679,4 +679,15 @@ select id, vali, valv, auto_incrementing_id from insert_non_unique_key_test_tbl4
 2,2,'two',1
 ---- TYPES
 INT,BIGINT,STRING,BIGINT
+====
+---- QUERY
+# Regression test for IMPALA-10829.
+set ABORT_ON_ERROR=1;
+create table impala_10829_tbl (id int, primary key(id))
+    partition by hash partitions 3 stored as kudu;
+insert /*+clustered*/ into impala_10829_tbl
+    select case id when 0 then 1 else 2 end from functional.alltypestiny;
+---- RUNTIME_PROFILE
+NumModifiedRows: 2
+NumRowErrors: 6
 ====
\ No newline at end of file