Make your own Transform
1. Create your own Transform template
template = """
SELECT {{ group_by | join(', ') }},
listagg({{ 'distinct ' if distinct else ''}} {{agg_column}}, '{{sep}}')
WITHIN group (order by {{agg_column}} {{order}}) as {{agg_column}}_listagg
FROM {{ source_table }}
GROUP BY {{ group_by | join(', ') }}
"""
2. Publish your Transform template
# Create a new user-defined transform
new_transform = rasgo.create.transform(name="aggregate_string",
source_code=template)
Last updated
Was this helpful?