Saving all output to "!!{outputDirectory}!!/udaf_covar_samp.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/udaf_covar_samp.q >>> DROP TABLE covar_tab; No rows affected >>> CREATE TABLE covar_tab (a INT, b INT, c INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' STORED AS TEXTFILE; No rows affected >>> LOAD DATA LOCAL INPATH '../data/files/covar_tab.txt' OVERWRITE INTO TABLE covar_tab; No rows affected >>> >>> DESCRIBE FUNCTION covar_samp; 'tab_name' 'covar_samp(x,y) - Returns the sample covariance of a set of number pairs' 1 row selected >>> DESCRIBE FUNCTION EXTENDED covar_samp; 'tab_name' 'covar_samp(x,y) - Returns the sample covariance of a set of number pairs' 'The function takes as arguments any pair of numeric types and returns a double.' 'Any pair with a NULL is ignored. If the function is applied to an empty set, NULL' 'will be returned. Otherwise, it computes the following:' ' (SUM(x*y)-SUM(x)*SUM(y)/COUNT(x,y))/(COUNT(x,y)-1)' 'where neither x nor y is null.' 6 rows selected >>> SELECT covar_samp(b, c) FROM covar_tab WHERE a < 1; '_c0' '' 1 row selected >>> SELECT covar_samp(b, c) FROM covar_tab WHERE a < 3; '_c0' '' 1 row selected >>> SELECT covar_samp(b, c) FROM covar_tab WHERE a = 3; '_c0' '0.0' 1 row selected >>> SELECT a, covar_samp(b, c) FROM covar_tab GROUP BY a ORDER BY a; 'a','_c1' '1','' '2','' '3','0.0' '4','0.0' '5','0.0' '6','0.0' 6 rows selected >>> SELECT covar_samp(b, c) FROM covar_tab; '_c0' '4.833333333333332' 1 row selected >>> >>> DROP TABLE covar_tab; No rows affected >>> !record