mirror of
https://github.com/apache/impala.git
synced 2025-12-31 15:00:10 -05:00
Also includes some misc pattern matching cleanup. Change-Id: I6c9ec78b094a73864b4d669afbd75a48c9bf9585 Reviewed-on: http://gerrit.ent.cloudera.com:8080/2199 Tested-by: jenkins Reviewed-by: Nong Li <nong@cloudera.com> Reviewed-on: http://gerrit.ent.cloudera.com:8080/2271
215 lines
4.6 KiB
Plaintext
215 lines
4.6 KiB
Plaintext
====
|
|
---- 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, STRING
|
|
====
|
|
---- QUERY
|
|
# Verify all the test functions are removed
|
|
show aggregate functions in function_ddl_test
|
|
---- RESULTS
|
|
---- TYPES
|
|
STRING, 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
|
|
'INT','fn()'
|
|
---- TYPES
|
|
STRING, STRING
|
|
====
|
|
---- QUERY
|
|
show functions in function_ddl_test
|
|
---- RESULTS
|
|
'INT','fn_var_arg(INT...)'
|
|
'INT','fn2(INT)'
|
|
'INT','fn2(INT, STRING)'
|
|
'INT','fn()'
|
|
'DOUBLE','fn(INT)'
|
|
'INT','fn(INT, STRING)'
|
|
'INT','fn(STRING, INT)'
|
|
---- TYPES
|
|
STRING, STRING
|
|
====
|
|
---- QUERY
|
|
show aggregate functions in function_ddl_test
|
|
---- RESULTS
|
|
'BIGINT','agg_fn(INT)'
|
|
'INT','agg_fn(INT, STRING)'
|
|
---- TYPES
|
|
STRING, STRING
|
|
====
|
|
---- QUERY
|
|
drop function function_ddl_test.fn2(int, string)
|
|
====
|
|
---- QUERY
|
|
show functions
|
|
---- RESULTS
|
|
'INT','fn_var_arg(INT...)'
|
|
'INT','fn2(INT)'
|
|
'INT','fn()'
|
|
'DOUBLE','fn(INT)'
|
|
'INT','fn(INT, STRING)'
|
|
'INT','fn(STRING, INT)'
|
|
---- TYPES
|
|
STRING, STRING
|
|
====
|
|
---- QUERY
|
|
drop function if exists function_ddl_test.fn2(int, string)
|
|
====
|
|
---- QUERY
|
|
show functions in function_ddl_test
|
|
---- RESULTS
|
|
'INT','fn_var_arg(INT...)'
|
|
'INT','fn2(INT)'
|
|
'INT','fn()'
|
|
'DOUBLE','fn(INT)'
|
|
'INT','fn(INT, STRING)'
|
|
'INT','fn(STRING, INT)'
|
|
---- TYPES
|
|
STRING, STRING
|
|
====
|
|
---- QUERY
|
|
show functions in default;
|
|
---- RESULTS
|
|
'INT','fn()'
|
|
---- TYPES
|
|
STRING, STRING
|
|
====
|
|
---- QUERY
|
|
drop function default.fn()
|
|
====
|
|
---- QUERY
|
|
show functions in default;
|
|
---- RESULTS
|
|
---- TYPES
|
|
STRING, STRING
|
|
====
|
|
---- QUERY
|
|
show functions in function_ddl_test;
|
|
---- RESULTS
|
|
'INT','fn_var_arg(INT...)'
|
|
'INT','fn2(INT)'
|
|
'INT','fn()'
|
|
'DOUBLE','fn(INT)'
|
|
'INT','fn(INT, STRING)'
|
|
'INT','fn(STRING, INT)'
|
|
---- TYPES
|
|
STRING, STRING
|
|
====
|
|
---- QUERY
|
|
drop function fn()
|
|
====
|
|
---- QUERY
|
|
show functions;
|
|
---- RESULTS
|
|
'INT','fn_var_arg(INT...)'
|
|
'INT','fn2(INT)'
|
|
'DOUBLE','fn(INT)'
|
|
'INT','fn(INT, STRING)'
|
|
'INT','fn(STRING, INT)'
|
|
---- TYPES
|
|
STRING, STRING
|
|
====
|
|
---- QUERY
|
|
drop function fn_var_arg(INT...)
|
|
====
|
|
---- QUERY
|
|
show functions;
|
|
---- RESULTS
|
|
'INT','fn2(INT)'
|
|
'DOUBLE','fn(INT)'
|
|
'INT','fn(INT, STRING)'
|
|
'INT','fn(STRING, INT)'
|
|
---- TYPES
|
|
STRING, STRING
|
|
====
|
|
---- QUERY
|
|
drop function agg_fn(int)
|
|
====
|
|
---- QUERY
|
|
show aggregate functions
|
|
---- RESULTS
|
|
'INT','agg_fn(INT, STRING)'
|
|
---- TYPES
|
|
STRING, STRING
|
|
====
|
|
---- QUERY
|
|
# Call invalidate metadata and make sure the functions are still there
|
|
invalidate metadata
|
|
---- RESULTS
|
|
---- TYPES
|
|
====
|
|
---- QUERY
|
|
show functions
|
|
---- RESULTS
|
|
'INT','fn2(INT)'
|
|
'DOUBLE','fn(INT)'
|
|
'INT','fn(INT, STRING)'
|
|
'INT','fn(STRING, INT)'
|
|
---- TYPES
|
|
STRING, STRING
|
|
====
|
|
---- QUERY
|
|
show aggregate functions
|
|
---- RESULTS
|
|
'INT','agg_fn(INT, STRING)'
|
|
---- TYPES
|
|
STRING, STRING
|
|
==== |