SELECT
prc.user_key,
percentile(P.price, 0.5) OVER (PARTITION BY P.user_key) as median_price
FROM
(
SELECT
vfc.user_key,
vfc.order_id,
MIN(vddo.cc) price
FROM
td_b.mv_a vfc
JOIN
td_b.dim_deal_option vddo
ON vfc.d_key = vddo.d_key
WHERE
vfc.action = 'sale'
GROUP BY vfc.user_key, vfc.order_id
) prc limit 100;
在 Hive 中给出错误“FAILED: Parse Error: line 4:13 mismatched input '(' Expecting FROM near 'OVER' in from 子句”在 Hive 中。当我删除百分位数和分区查询工作正常时,知道吗?我试过 count()而不是百分位数,仍然是同样的错误。