0

Can you limit array_agg in AWS athena? In postgres you can use this syntax, see this question.

SELECT 
    key
    , array_agg(value LIMIT 100) as values
FROM table
Roelant
  • 3,727
  • 1
  • 25
  • 55

1 Answers1

1

You can actually use slice to do it:

SELECT 
    key
    , slice(array_agg(value),1,100) as values
FROM table

Please note that the array index starts at 1

Guy
  • 11,700
  • 3
  • 42
  • 63