I have a CDK connector with a parent stream and ch...
# ask-ai
g
I have a CDK connector with a parent stream and child stream in airbyte, where the parent stream is incremental, and the child stream is not, but it should only process new records from the incremental parent. I ran a second sync of the streams - the parent stream was incremental as expected, but the child stream did not only process new records, it processed also all the previous records which were previously obtained from the parent
k
The behavior you're seeing is expected with the current Airbyte CDK implementation: if your parent stream is incremental but your child stream is not, the child stream will perform a full refresh of all parent records, not just the new ones. This is because, by default, the child stream (when inheriting from
HttpSubStream
) calls the parent stream with
SyncMode.full_refresh
, regardless of the parent's incremental state. As a result, the child stream reprocesses all parent records on every sync, not just the new or updated ones. To achieve the behavior where the child stream only processes new records from the incremental parent, both streams need to be incremental and share the same cursor field. Alternatively, you would need to implement a custom
stream_slices
method in your child stream that reads the parent stream with
SyncMode.incremental
and only processes the new records accordingly. This is not handled automatically by the CDK for non-incremental child streams, and there is currently no built-in mechanism to make a non-incremental child stream process only new parent records in incremental syncs. This limitation is discussed in the official Airbyte forum and GitHub issues: - "If your parent stream is set to incremental and your child stream is not, the child stream will run a full refresh of the parent stream because the
HttpSubStream
calls the parent stream with
SyncMode.full_refresh
." [How does sync mode work with sub stream / nested stream?](https://discuss.airbyte.io/t/587) - There are open feature requests and discussions about supporting this use case, but as of now, it is not natively supported in the CDK. [Substream cursor GitHub issue](https://github.com/airbytehq/airbyte/issues/28278) In summary: with the current Airbyte CDK, a non-incremental child stream will always process all parent records, even if the parent is incremental. To limit the child stream to only new parent records, both streams must be incremental, or you must implement custom logic.