0

Looking for help on how to do something like this: Find connected edges in the graph

But in Redshift.

So have data which looks like this:

        union
        select 'b' as user, 'v1' as visitor_id
        union
        select 'b' as user, 'v2' as visitor_id
        union
        select 'c' as user, 'v2' as visitor_id
        union
        select 'c' as user, 'v3' as visitor_id
        union
        select 'd' as user, 'v3' as visitor_id
         union
        select 'e' as user, 'v30' as visitor_id

And want to group them together based on transitive rules, so a,b,c,d to belong together, while e is separate group.

have a quite big table i need to run grouping like this. So kinda traversing asyclic graph (so not really a parent child relationship) and identifying groups.

Here is i think Teradata solution, How to group/List all nodes of a undirected graph using teradata sql but interested in how it could work in redshift.

Thank you

Srdjan Nikitovic
  • 853
  • 2
  • 9
  • 19

0 Answers0