Hello Meltano community, I am working on a tap and...
# singer-tap-development
c
Hello Meltano community, I am working on a tap and I have a parent/child stream question. If I have two different parent streams that contribute the same id to a child stream, how can I configure the streams so that it works. Right now I can choose one of the parents or the other and I can get the tap to work, but not when I choose both. Can I duplicate the child and have each of the children refer to a different parent? Thanks for the help!
To give some more context.
Copy code
Stream A has a calendar_id
Stream B also has a calendar_id

Stream C needs the calendar_id from both Stream A and Stream B.
e
Hi @chris_marchetti! One question to help me understand your use case: do the calendar IDs produced by streams A and B overlap? If the answer is NO, then you could do as you say and duplicate the child stream class to use the different parent classes:
Copy code
class StreamA:
  ...

Class StreamB:
  ...

Class ChildA:
  parent_stream_type = StreamA

Class ChildB:
  parent_stream_type = StreamB
You may run into problems if using incremental replication for the child stream(s), so I’d use different stream names for each. If the IDs overlap, then it complicates things a bit. Your use case would benefit from some form of context registry in the stream that it can use to dedup calendar IDs by skipping them if they’ve already been processed. This might not be possible to do with the stream classes as they exist, though.
c
Thanks for the help! After I asked the question I tried to use the second child class as you suggested. It seems to work so far.