mirror of
https://github.com/apache/impala.git
synced 2026-02-02 06:00:36 -05:00
IMPALA-1456: Hive UDFs with String args would crash impalad
The wrong buffer was being used. Change-Id: I18bf9040eaeda871d1d0baee2e276749a3a38615 Reviewed-on: http://gerrit.sjc.cloudera.com:8080/5185 Reviewed-by: Casey Ching <casey@cloudera.com> Tested-by: jenkins
This commit is contained in:
@@ -71,11 +71,15 @@ double
|
||||
10
|
||||
====
|
||||
---- QUERY
|
||||
select udf_test.identity("why hello there");
|
||||
# IMPALA-1456. Each "identity" call below tests a different type (BytesWritable, Text,
|
||||
# and String).
|
||||
select udf_test.identity("why hello there"),
|
||||
udf_test.identity("why", " hello there"),
|
||||
udf_test.identity("why", " hello", " there");
|
||||
---- TYPES
|
||||
string
|
||||
string, string, string
|
||||
---- RESULTS
|
||||
'why hello there'
|
||||
'why hello there','why hello there','why hello there'
|
||||
====
|
||||
---- QUERY
|
||||
select udf_test.identity(NULL);
|
||||
@@ -85,12 +89,13 @@ boolean
|
||||
NULL
|
||||
====
|
||||
---- QUERY
|
||||
# IMPALA-1134. Each "identity" call below tests a different type (BytesWritable and Text).
|
||||
# The different types are handled slightly differently.
|
||||
# IMPALA-1134. Each "identity" call below tests a different type (BytesWritable, Text,
|
||||
# and String). The different types are handled slightly differently.
|
||||
select length(udf_test.identity("0123456789")),
|
||||
length(udf_test.identity("0123456789", "0123456789"));
|
||||
length(udf_test.identity("0123456789", "0123456789")),
|
||||
length(udf_test.identity("0123456789", "0123456789", "0123456789"));
|
||||
---- TYPES
|
||||
int, int
|
||||
int, int, int
|
||||
---- RESULTS
|
||||
10,20
|
||||
10,20,30
|
||||
====
|
||||
|
||||
@@ -16,6 +16,7 @@ drop function if exists udf_test.identity(float);
|
||||
drop function if exists udf_test.identity(double);
|
||||
drop function if exists udf_test.identity(string);
|
||||
drop function if exists udf_test.identity(string, string);
|
||||
drop function if exists udf_test.identity(string, string, string);
|
||||
drop function if exists udf_test.identity(timestamp);
|
||||
|
||||
create database if not exists udf_test;
|
||||
@@ -79,4 +80,8 @@ symbol='com.cloudera.impala.TestUdf';
|
||||
create function udf_test.identity(string, string) returns string
|
||||
location '/test-warehouse/impala-hive-udfs.jar'
|
||||
symbol='com.cloudera.impala.TestUdf';
|
||||
|
||||
create function udf_test.identity(string, string, string) returns string
|
||||
location '/test-warehouse/impala-hive-udfs.jar'
|
||||
symbol='com.cloudera.impala.TestUdf';
|
||||
====
|
||||
|
||||
Reference in New Issue
Block a user