Files
impala/testdata/workloads/functional-query/queries/QueryTest/functions-ddl.test
Nong Li 4bb1e8c854 Add varargs to UDF/UDA parser/analyzer.
Change-Id: I4c3f2e74f6c29cee4b0b787c058b0455b16a11fd
Reviewed-on: http://gerrit.ent.cloudera.com:8080/548
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Tested-by: jenkins
2014-01-08 10:53:05 -08:00

186 lines
3.8 KiB
Plaintext

====
---- QUERY
create database if not exists function_ddl_test
====
---- QUERY
# Drop the dummy udfs this test uses.
drop function if exists function_ddl_test.fn();
drop function if exists function_ddl_test.fn(int);
drop function if exists function_ddl_test.fn(int, string);
drop function if exists function_ddl_test.fn(string, int);
drop function if exists function_ddl_test.fn2(int);
drop function if exists function_ddl_test.fn2(int, string);
drop function if exists function_ddl_test.fn_var_arg(int...);
drop function if exists function_ddl_test.agg_fn(int);
drop function if exists function_ddl_test.agg_fn(int, string);
drop function if exists function_ddl_test.agg_fn_var_arg(double, string...);
====
---- QUERY
# Verify all the test functions are removed
show functions in function_ddl_test
---- RESULTS
---- TYPES
STRING
====
---- QUERY
# Verify all the test functions are removed
show aggregate functions in function_ddl_test
---- RESULTS
---- TYPES
STRING
====
---- QUERY
# Add them and test function overloading.
create function function_ddl_test.fn() RETURNS int LOCATION '/test.so' SYMBOL='foo'
====
---- QUERY
create function function_ddl_test.fn(int) RETURNS double LOCATION '/test.so' SYMBOL='foo'
====
---- QUERY
create function function_ddl_test.fn(int, string)
RETURNS int LOCATION '/test.jar' SYMBOL='foo.class'
====
---- QUERY
create function function_ddl_test.fn(string, int)
RETURNS int LOCATION '/test.ll' SYMBOL='foo.class'
====
---- QUERY
create function function_ddl_test.fn2(int)
RETURNS int LOCATION '/test.so' SYMBOL='foo.class'
====
---- QUERY
create function function_ddl_test.fn2(int, string)
RETURNS int LOCATION '/test.so' SYMBOL='foo'
====
---- QUERY
create function function_ddl_test.fn_var_arg(int...)
RETURNS int LOCATION '/test.so' SYMBOL='foo'
====
---- QUERY
create aggregate function function_ddl_test.agg_fn(int)
RETURNS int LOCATION '/test.so' UPDATE_FN='UpdateFn'
====
---- QUERY
create aggregate function function_ddl_test.agg_fn(int, string)
RETURNS int LOCATION '/test.so' UPDATE_FN='UpdateFn'
====
---- QUERY
create aggregate function function_ddl_test.agg_fn_var_arg(double, string...)
RETURNS int LOCATION '/test.so' UPDATE_FN='UpdateFn'
====
---- QUERY
show functions in function_ddl_test
---- RESULTS
'fn()'
'fn(INT)'
'fn(INT, STRING)'
'fn(STRING, INT)'
'fn2(INT)'
'fn2(INT, STRING)'
'fn_var_arg(INT...)'
---- TYPES
STRING
====
---- QUERY
show aggregate functions in function_ddl_test
---- RESULTS
'agg_fn(INT)'
'agg_fn(INT, STRING)'
'agg_fn_var_arg(DOUBLE, STRING...)'
---- TYPES
STRING
====
---- QUERY
drop function function_ddl_test.fn2(int, string)
====
---- QUERY
show functions in function_ddl_test
---- RESULTS
'fn()'
'fn(INT)'
'fn(INT, STRING)'
'fn(STRING, INT)'
'fn2(INT)'
'fn_var_arg(INT...)'
---- TYPES
STRING
====
---- QUERY
drop function if exists function_ddl_test.fn2(int, string)
====
---- QUERY
show functions in function_ddl_test
---- RESULTS
'fn()'
'fn(INT)'
'fn(INT, STRING)'
'fn(STRING, INT)'
'fn2(INT)'
'fn_var_arg(INT...)'
---- TYPES
STRING
====
---- QUERY
use function_ddl_test
====
---- QUERY
show functions;
---- RESULTS
'fn()'
'fn(INT)'
'fn(INT, STRING)'
'fn(STRING, INT)'
'fn2(INT)'
'fn_var_arg(INT...)'
---- TYPES
STRING
====
---- QUERY
drop function fn()
====
---- QUERY
show functions;
---- RESULTS
'fn(INT)'
'fn(INT, STRING)'
'fn(STRING, INT)'
'fn2(INT)'
'fn_var_arg(INT...)'
---- TYPES
STRING
====
---- QUERY
drop function fn_var_arg(INT...)
====
---- QUERY
show functions;
---- RESULTS
'fn(INT)'
'fn(INT, STRING)'
'fn(STRING, INT)'
'fn2(INT)'
---- TYPES
STRING
====
---- QUERY
drop function agg_fn(int)
====
---- QUERY
show aggregate functions;
---- RESULTS
'agg_fn(INT, STRING)'
'agg_fn_var_arg(DOUBLE, STRING...)'
---- TYPES
STRING
====
---- QUERY
drop function agg_fn_var_arg(double, string...)
====
---- QUERY
show aggregate functions;
---- RESULTS
'agg_fn(INT, STRING)'
---- TYPES
STRING
====