【发布时间】:2021-07-27 01:07:15
【问题描述】:
我需要按组创建行号。在 mysql 中,我为此使用“用户定义的变量”。 但是在 Athena 中给了我一个错误:在输入 '@' 处没有可行的选择
这是我的查询:
SELECT @row_num := IF(@prev_value=concat_ws('',t.user_id,t.campaign_id,t.placement_id, t.creative_id),@row_num+1,1) AS RowNumber
,t.user_id
,t.campaign_id
,t.placement_id
,t.creative_id
, t.imp_clk_event_dt
,@prev_value := concat_ws('',t.user_id,t.campaign_id,t.placement_id, t.creative_id)
FROM e2c_conv t,
(SELECT @row_num := 1) x,
(SELECT @prev_value := '') y ORDER BY t.user_id,t.campaign_id,t.placement_id, t.creative_id, t.imp_clk_event_dt
任何有关如何解决此问题的建议都将受到高度赞赏。
【问题讨论】:
-
athena 不像 HIVE 那样支持
concat_ws -
Presto 现在更名为 Trino
标签: amazon-web-services variables session-variables amazon-athena