我有一个SQL查询,如下所示。我想将此转换为hive查询,这可能吗?使用cloudera / hadoop。感谢
DECLARE
@sd_y FLOAT,
@sd_x1 FLOAT,
@sd_x2 FLOAT,
SELECT
@sd_y = SUM(Y_w*Y),
@sd_x1 = SUM(Y_w*X1),
@sd_x2 = SUM(Y_w*X2)
FROM dbo.c
UPDATE dbo.c
SET
Y = SQRT(Y_w)*(Y-@sd_y),
X1 = SQRT(Y_w)*(X1-@sd_x1),
X2 = SQRT(Y_w)*(X2-@sd_x2)
SELECT
@sd_y,
@sd_x1,
@sd_x2