mirror of
https://github.com/apache/impala.git
synced 2026-01-07 18:02:33 -05:00
UDF/UDA memory management improvements
* AggFnEvaluator now uses the UDF mem pool (I'm planning to change this to per-exec node pools in the expr refactoring) * FunctionContext::TrackAllocation()/Free() actually use the UDF's mem tracker * Added FunctionContextImpl::Close() which sets warnings for leaked allocations Change-Id: I792ffd49102a92b57e34df18d8ff5f5d0fd27370 Reviewed-on: http://gerrit.ent.cloudera.com:8080/1792 Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com> Tested-by: Skye Wanderman-Milne <skye@cloudera.com> (cherry picked from commit 41a5f7cfa718789fa3b2de3a31f085411fb5000c) Reviewed-on: http://gerrit.ent.cloudera.com:8080/1954 Tested-by: jenkins
This commit is contained in:
committed by
jenkins
parent
4638505cba
commit
44125729dc
12
testdata/workloads/functional-query/queries/QueryTest/uda-mem-limit.test
vendored
Normal file
12
testdata/workloads/functional-query/queries/QueryTest/uda-mem-limit.test
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
====
|
||||
---- QUERY
|
||||
create database if not exists native_function_test;
|
||||
use native_function_test;
|
||||
|
||||
drop function if exists agg_memtest(bigint);
|
||||
|
||||
create aggregate function agg_memtest(bigint) returns bigint
|
||||
location '/test-warehouse/libTestUdas.so' update_fn='MemTestUpdate';
|
||||
|
||||
select agg_memtest(bigint_col * 10 * 1024 * 1024) from functional.alltypes;
|
||||
====
|
||||
14
testdata/workloads/functional-query/queries/QueryTest/udf-mem-limit.test
vendored
Normal file
14
testdata/workloads/functional-query/queries/QueryTest/udf-mem-limit.test
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
====
|
||||
---- QUERY
|
||||
create database if not exists native_function_test;
|
||||
use native_function_test;
|
||||
|
||||
drop function if exists memtest(bigint);
|
||||
|
||||
create function memtest(bigint) returns bigint
|
||||
location '/test-warehouse/libTestUdfs.so' symbol='MemTest'
|
||||
prepare_fn='_Z14MemTestPreparePN10impala_udf15FunctionContextENS0_18FunctionStateScopeE'
|
||||
close_fn='_Z12MemTestClosePN10impala_udf15FunctionContextENS0_18FunctionStateScopeE';
|
||||
|
||||
select * from functional.alltypes where bigint_col > memtest(10 * 1024 * 1024)
|
||||
====
|
||||
Reference in New Issue
Block a user