Amazon Athena 中的重复值

Repeat value in Amazon Athena

我想重复一个项目 n 次(其中 n 是从另一列给出的)。

Presto 包含重复功能https://prestodb.io/docs/current/functions/array.html,但 Athena 不支持它。那么,还有其他方法可以重复项目吗?

例如 (X, 3) -> [X, X, X]。

是的,Athena 不支持此功能,因为此时 Athena 使用 Presto 0.172 版本,而此版本的 Presto 未实现上述功能。我认为您找不到替代功能,只能使用这样的解决方法:

transform(sequence(1, 3), x-> 'X')