Reputation: 52840
I need to find a string concatenation function in AWS Glue inside GROUP BY, so far tried
SELECT CONCAT('wo', 'rd');
for which I need concatenation inside GROUP BY, written in meta language:
SELECT CONCAT(field_word WITH SEPARATOR '>' ORDER BY Order1) FROM myData GROUP BY ID;
SELECT STRING_AGG(field_word WITH SEPARATOR '>' ORDER BY Order1) FROM myData GROUP BY ID;
but the earlier do not work.
How can I concatenate strings inside AWS Glue athena?
Upvotes: 0
Views: 10392
Reputation: 20730
You can combine array_agg
with array_join
:
presto> SELECT array_join(array_agg(e), ',', 'NULL')
-> FROM (VALUES 'wo', 'rd') t(e);
_col0
-------
wo,rd
(1 row)
Upvotes: 2