Files
impala/testdata/workloads/functional-query/queries/QueryTest/functions-ddl.test
Lenni Kuff 01c8c43fec Uniquify FUNCTION catalog topic entry keys by including parent database name
Change-Id: I6aa49520f548ddfcd557e2f908a09be454765e8c
Reviewed-on: http://gerrit.ent.cloudera.com:8080/698
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: Lenni Kuff <lskuff@cloudera.com>
2014-01-08 10:53:29 -08:00

219 lines
4.4 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);
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 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
create aggregate function function_ddl_test.agg_fn_var_arg(double, string...) RETURNS int
LOCATION '/test-warehouse/libTestUdas.so' UPDATE_FN='VarArgUpdate'
====
---- 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)'
'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 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)'
'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
====