mirror of
https://github.com/apache/impala.git
synced 2026-01-06 06:01:03 -05:00
Our .test file parser used to not abort tests when there is a malformed test/section. This patch changes that behavior to report an error and treat the test as failed. Quite a few tests were not well-formed, and were not executed as a result. This patch fixes those tests. Arguably, the test file parser should be more flexible in which places to accept comments, but this patch does not address that problem. Change-Id: If53358eb0cb958b68e51940b071e64c1d6c3ec6f Reviewed-on: http://gerrit.sjc.cloudera.com:8080/5468 Reviewed-by: Alex Behm <alex.behm@cloudera.com> Tested-by: jenkins
124 lines
2.1 KiB
Plaintext
124 lines
2.1 KiB
Plaintext
====
|
|
---- QUERY
|
|
select udf_test.hive_pi()
|
|
---- RESULTS
|
|
3.141592653589793
|
|
---- TYPES
|
|
DOUBLE
|
|
====
|
|
---- QUERY
|
|
select udf_test.hive_bin(100)
|
|
---- RESULTS
|
|
'1100100'
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
select min(udf_test.hive_pi()) from functional.alltypesagg
|
|
---- RESULTS
|
|
3.141592653589793
|
|
---- TYPES
|
|
DOUBLE
|
|
====
|
|
---- QUERY
|
|
# Test identity functions
|
|
select udf_test.identity(true);
|
|
---- TYPES
|
|
boolean
|
|
---- RESULTS
|
|
true
|
|
====
|
|
---- QUERY
|
|
select udf_test.identity(cast(10 as tinyint));
|
|
---- TYPES
|
|
tinyint
|
|
---- RESULTS
|
|
10
|
|
====
|
|
---- QUERY
|
|
select udf_test.identity(cast(10 as smallint));
|
|
---- TYPES
|
|
smallint
|
|
---- RESULTS
|
|
10
|
|
====
|
|
---- QUERY
|
|
select udf_test.identity(cast(10 as int));
|
|
---- TYPES
|
|
int
|
|
---- RESULTS
|
|
10
|
|
====
|
|
---- QUERY
|
|
select udf_test.identity(cast(10 as bigint));
|
|
---- TYPES
|
|
bigint
|
|
---- RESULTS
|
|
10
|
|
====
|
|
---- QUERY
|
|
select udf_test.identity(cast(10.0 as float));
|
|
---- TYPES
|
|
float
|
|
---- RESULTS
|
|
10
|
|
====
|
|
---- QUERY
|
|
select udf_test.identity(cast(10.0 as double));
|
|
---- TYPES
|
|
double
|
|
---- RESULTS
|
|
10
|
|
====
|
|
---- QUERY
|
|
# 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
|
|
---- RESULTS
|
|
'why hello there','why hello there','why hello there'
|
|
====
|
|
---- QUERY
|
|
select udf_test.identity(NULL);
|
|
---- TYPES
|
|
boolean
|
|
---- RESULTS
|
|
NULL
|
|
====
|
|
---- QUERY
|
|
# 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", "0123456789"));
|
|
---- TYPES
|
|
int, int, int
|
|
---- RESULTS
|
|
10,20,30
|
|
====
|
|
---- QUERY
|
|
# IMPALA-1392: Hive UDFs that throw exceptions should return NULL
|
|
select udf_test.throws_exception();
|
|
---- TYPES
|
|
boolean
|
|
---- RESULTS
|
|
NULL
|
|
====
|
|
---- QUERY
|
|
select udf_test.throws_exception() from functional.alltypestiny;
|
|
---- TYPES
|
|
boolean
|
|
---- RESULTS
|
|
NULL
|
|
NULL
|
|
NULL
|
|
NULL
|
|
NULL
|
|
NULL
|
|
NULL
|
|
NULL
|
|
====
|