Hello,
We have a need for something like the User Defined Transform Function (UDTF) group_concat that can be found in the Vertica-Extension-Packages repository.
However, we want to be able to call that function on mutiple columns from the same table.
e.g., we want to do:
select
id,
group_concat(colX) over (partition by id order by mytime),
group concat(colY) over (partition by id order by mytime)
from my_example_table;
Since we can't call the UDTF multiple times in the same select list, we are thinking of reimplementing group_concat as a user defined analytic function (UDAnF). So, we have two questions:
1. Can a UDAnF be called multiple times in a select list? The documentation for UDTF is clear but it is not for UDAnF.
2. Assuming yes to question #1, is there a good example of a UDAnF that you can point us to that takes an expression and returns a single value per partition group (like first_value or lag)? The example in the documentation is for Rank and doesn't illustrate some of the complexities we expect to encounter.
Thanks in advance for any help.
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.