HI I just want to ask if there is a way in airbyte...
# replication-troubleshooting
a
HI I just want to ask if there is a way in airbyte whereby we only replicate the no. of records we want. Let's say I've 100000 records in my source but I want only 10k records in my destination. So just curious if there's any workaround.
e
Hi. What your asking is a bit more complex since if you want 10k instead of 100k records which 10k you want? the first 10k? the last 10k? random 10k? if you want sorted by asc or desc, first search this option in the api you pull from since sorting the data after you get it requires more code and skills to achieve, since the sorting algorithms needs to be fast or else it doesn`t worth it. any how you need to add code i.e. either add logic to existing source or build a new one with that option - keep in mind that getting only X/Y records requires streaming the data and chunking it and then adding more code. It is easier to download the data and then sample (rarely you need parts of data for the long run and not the whole data)
👍 1
a
Let's say I want the first 10k rows without even pulling the whole data. Do you know how to do it? Because selecting particular data after we have pulled whole will be easier
e
Like I said before - you cannot decide how much data you get from an API unless it is possible via that same API- what you can do is decide how much you process from that API response. getting first 10k elements of data depends on the amount of overall data since you can use regular loop, pandas, numpy, dask etc... to process this data. the easiest answer - slice it
👍 1