Files
impala/testdata/workloads/functional-query/queries/QueryTest/functions-ddl.test
Nong Li 601f24a198 UDA execution loose ends.
Unfortunately, the BE does not have the codegen path to execute UDAs.
This puts some restrictions on the UDAs we can run.

- No IR UDAs
- No varargs
- Must have 8 arguments or less.

The code to do this is almost all there for UDFs but I'm not sure I'll get to it.

Change-Id: I8a06e635a9138397c8474a5704c3e588bb92347b
Reviewed-on: http://gerrit.ent.cloudera.com:8080/703
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: Nong Li <nong@cloudera.com>
2014-01-08 10:53:38 -08:00

225 lines
4.3 KiB
Plaintext

====
---- QUERY
create database if not exists function_ddl_test
====
---- QUERY
# Drop the dummy udfs this test uses.
drop function if exists default.fn();
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);
====
---- 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 and scoping.
create function default.fn() RETURNS int
LOCATION '/test-warehouse/libTestUdfs.so' SYMBOL='Fn'
====
---- QUERY
create function function_ddl_test.fn() RETURNS int
LOCATION '/test-warehouse/libTestUdfs.so' SYMBOL='Fn'
====
---- QUERY
create function function_ddl_test.fn(int) RETURNS double
LOCATION '/test-warehouse/libTestUdfs.so' SYMBOL='Fn'
====
---- QUERY
create function function_ddl_test.fn(int, string) RETURNS int
LOCATION '/test-warehouse/libTestUdfs.so' SYMBOL='Fn'
====
---- QUERY
create function function_ddl_test.fn(string, int) RETURNS int
LOCATION '/test-warehouse/libTestUdfs.so' SYMBOL='Fn'
====
---- QUERY
create function function_ddl_test.fn2(int) RETURNS int
LOCATION '/test-warehouse/libTestUdfs.so' SYMBOL='Fn2'
====
---- QUERY
create function function_ddl_test.fn2(int, string) RETURNS int
LOCATION '/test-warehouse/libTestUdfs.so' SYMBOL='Fn2'
====
---- QUERY
create function function_ddl_test.fn_var_arg(int...) RETURNS int
LOCATION '/test-warehouse/libTestUdfs.so' SYMBOL='VarSum'
====
---- QUERY
create aggregate function function_ddl_test.agg_fn(int) RETURNS bigint
LOCATION '/test-warehouse/libudasample.so' UPDATE_FN='CountUpdate'
====
---- QUERY
create aggregate function function_ddl_test.agg_fn(int, string) RETURNS int
LOCATION '/test-warehouse/libTestUdas.so' UPDATE_FN='TwoArgUpdate'
====
---- QUERY
show functions in default
---- RESULTS
'fn()'
---- TYPES
STRING
====
---- 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)'
---- 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 default
====
---- QUERY
show functions;
---- RESULTS
'fn()'
---- TYPES
STRING
====
---- QUERY
drop function fn()
====
---- QUERY
show functions;
---- RESULTS
---- 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)'
---- TYPES
STRING
====
---- QUERY
# Call invalidate metadata and make sure the functions are still there
invalidate metadata
---- RESULTS
---- TYPES
====
---- QUERY
show functions
---- RESULTS
'fn(INT)'
'fn(INT, STRING)'
'fn(STRING, INT)'
'fn2(INT)'
---- TYPES
STRING
====
---- QUERY
show aggregate functions
---- RESULTS
'agg_fn(INT, STRING)'
---- TYPES
STRING
====