2

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
  • 4,508
  • 1
  • 32
  • 62

1 Answers1

2

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
  • 12,388
  • 3
  • 45
  • 67