Files
impala/testdata/workloads/functional-query/queries/QueryTest/disable-codegen.test
Lars Volker a64cfc523e IMPALA-7032: Disable codegen for CHAR type null literals
Analogous to IMPALA-6435, we have to disable codegen for CHAR type null
literals. Otherwise we will crash in
impala::NullLiteral::GetCodegendComputeFn().

This change adds a test to make sure that the crash is fixed.

Change-Id: I34033362263cf1292418f69c5ca1a3b84aed39a9
Reviewed-on: http://gerrit.cloudera.org:8080/10409
Reviewed-by: Lars Volker <lv@cloudera.com>
Tested-by: Lars Volker <lv@cloudera.com>
2018-05-16 00:00:15 +00:00

61 lines
1.6 KiB
Plaintext

====
---- QUERY
# alltypes has 7300 rows - codegen should be enabled if there
# are < 1000 backend daemons.
set disable_codegen_rows_threshold=8;
select count(*) from alltypes t1
join alltypestiny t2 on t1.id = t2.id
---- RESULTS
8
---- TYPES
bigint
---- RUNTIME_PROFILE
# Verify that codegen was enabled for join and scan
row_regex: .*Build Side Codegen Enabled.*
row_regex: .*TEXT Codegen Enabled.*
====
---- QUERY
# alltypes has 7300 rows - codegen should be disabled regardless
# of # of backend impala daemons.
set disable_codegen_rows_threshold=8000;
select count(*) from alltypes t1
join alltypestiny t2 on t1.id = t2.id
---- RESULTS
8
---- TYPES
bigint
---- RUNTIME_PROFILE
# Verify that codegen was disabled
row_regex: .*Codegen Disabled: disabled due to optimization hints.*
====
---- QUERY
# IMPALA-6435: We do not codegen char columns. This fix checks for a
# CHAR type literal in the expr and disables codegen. This query will crash
# impala without the fix.
set disable_codegen_rows_threshold=0;
select count(*) from (
select cast('a' as char(4)) as s from functional.alltypestiny
union all
select cast('a' as char(4)) as s from functional.alltypestiny
union all
select cast(NULL as char(4)) as s from functional.alltypestiny
) t
---- RESULTS
24
---- TYPES
bigint
====
---- QUERY
# IMPALA-7032: Test that codegen gets disabled for CHAR type null literals in
# the backend. We force codegen to be on in order to exercise the codegen code
# for null literals.
set disable_codegen_rows_threshold=0;
select NULL from functional.alltypestiny
union select cast('a' as char(4)) from functional.alltypestiny
---- RESULTS
'a '
'NULL'
---- TYPES
char
====