mirror of
https://github.com/apache/impala.git
synced 2026-01-02 12:00:33 -05:00
This change moves the creation of the runtime profile from DataSink::Prepare() to the ctor of DataSink derived classes. This makes sure that DataSink::Close() and other functions can access the profile even if the DataSink fails to initialize. Testing done: Added a test case which triggers failure in the initialization of output expressions in a HdfsTableSink. Impalad crashed consistently without the fix. Change-Id: I2a683000ef180027b929dbebe78bc2a530a4767e Reviewed-on: http://gerrit.cloudera.org:8080/8770 Reviewed-by: Michael Ho <kwho@cloudera.com> Tested-by: Impala Public Jenkins
26 lines
1.0 KiB
Plaintext
26 lines
1.0 KiB
Plaintext
====
|
|
---- QUERY
|
|
# This test is run with codegen disabled. Interpretation only handles up to 20 arguments.
|
|
create function if not exists twenty_one_args(int, int, int, int, int, int,
|
|
int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) returns int
|
|
location '$FILESYSTEM_PREFIX/test-warehouse/libTestUdfs.so'
|
|
symbol='TwentyOneArgs';
|
|
---- RESULTS
|
|
====
|
|
---- QUERY
|
|
# Regression test for IMPALA-6262: failure to initialize the output expressions
|
|
# of data sink shouldn't crash Impalad.
|
|
insert overwrite table functional.insert_overwrite_nopart
|
|
select twenty_one_args(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,tinyint_col,
|
|
case when rand() > 0.5 then 20 else 0 end)
|
|
from functional.alltypessmall;
|
|
---- CATCH
|
|
Cannot interpret native UDF 'twenty_one_args': number of arguments is more than 20. Codegen is needed. Please set DISABLE_CODEGEN to false.
|
|
====
|
|
---- QUERY
|
|
drop function twenty_one_args(int, int, int, int, int, int, int, int,
|
|
int, int, int, int, int, int, int, int, int, int, int, int, int);
|
|
---- RESULTS
|
|
====
|
|
|