IMPALA-3350: Add some missing StringVal.is_null checks

Impala has a hardcoded limit of 1GB in size for StringVal.
If the length of the string exceeds 1GB, Impala will simply
mark the StringVal as NULL (i.e. is_null = true). It's important
that string functions or built-in UDFs check this field before
accessing the pointer or Impala may end up doing null pointer
access, leading to crashes.

Change-Id: I55777487fff15a521818e39b4f93a8a242770ec2
Reviewed-on: http://gerrit.cloudera.org:8080/2786
Reviewed-by: Dan Hecht <dhecht@cloudera.com>
Tested-by: Internal Jenkins
This commit is contained in:
Michael Ho
2016-04-13 16:00:39 -07:00
committed by Tim Armstrong
parent 56654a8364
commit 37a73ae9f7
9 changed files with 113 additions and 17 deletions

View File

@@ -1,5 +1,6 @@
====
---- QUERY
# TODO: IMPALA-3350: Add 'group by' to these tests to exercise different code paths.
select ndv(string_col) from functional.alltypes
---- CATCH
FunctionContext::Allocate() failed to allocate 1024 bytes.