blob: a2edec4d64e4ccc39783b362693fec597f4b01a0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
DROP TABLE covar_tab;
CREATE TABLE covar_tab (a INT, b INT, c INT)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED AS TEXTFILE;
LOAD DATA LOCAL INPATH '../../data/files/covar_tab.txt' OVERWRITE
INTO TABLE covar_tab;
DESCRIBE FUNCTION corr;
DESCRIBE FUNCTION EXTENDED corr;
SELECT corr(b, c) FROM covar_tab WHERE a < 1;
SELECT corr(b, c) FROM covar_tab WHERE a < 3;
SELECT corr(b, c) FROM covar_tab WHERE a = 3;
SELECT a, corr(b, c) FROM covar_tab GROUP BY a ORDER BY a;
SELECT corr(b, c) FROM covar_tab;
DROP TABLE covar_tab;
|