Alexander Ershov
Alexander Ershov

Reputation: 1157

Repeat value in Amazon Athena

I want to repeat an item n times (where n is given from another column).

Presto contains repeat function https://prestodb.io/docs/current/functions/array.html, but it's not supported by Athena. So, is there another way to repeat items?

For example (X, 3) -> [X, X, X].

Upvotes: 0

Views: 1112

Answers (1)

jbgorski
jbgorski

Reputation: 1939

Yes, this function isn't supported by Athena, because at this moment Athena uses Presto version 0.172 and this version of Presto doesn't have implemented mentioned function. I think that you will not find an alternative function, you can only use a workaround like this:

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

Upvotes: 1

Related Questions