Commit c0e2647
feat: add JsonItemsDecoder for streaming large JSON responses
Adds a streaming JSON decoder for very large single-document JSON responses where the
records live under a nested array. JsonItemsParser yields each array element via ijson,
so peak memory is bounded by a single record rather than the whole document. Composes
with the existing CompositeRawDecoder hierarchy (gzip/zip) and is wired into the decoder
unions + factory. Adds ijson as a first-class CDK dependency.
JsonItemsParser also honors a configured non-UTF-8 encoding by transcoding to UTF-8 bytes
via a lazy streaming recoder, keeping ijson on its native byte backend.
Adopts and supersedes #1026.
Co-Authored-By: devin-ai-integration[bot] <devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent fd95ecf commit c0e2647
7 files changed
Lines changed: 643 additions & 282 deletions
File tree
- airbyte_cdk/sources/declarative
- decoders
- models
- parsers
- unit_tests/sources/declarative/decoders
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2650 | 2650 | | |
2651 | 2651 | | |
2652 | 2652 | | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
2653 | 2687 | | |
2654 | 2688 | | |
2655 | 2689 | | |
| |||
2891 | 2925 | | |
2892 | 2926 | | |
2893 | 2927 | | |
| 2928 | + | |
2894 | 2929 | | |
2895 | 2930 | | |
2896 | 2931 | | |
| |||
3931 | 3966 | | |
3932 | 3967 | | |
3933 | 3968 | | |
| 3969 | + | |
3934 | 3970 | | |
3935 | 3971 | | |
3936 | 3972 | | |
| |||
4019 | 4055 | | |
4020 | 4056 | | |
4021 | 4057 | | |
| 4058 | + | |
4022 | 4059 | | |
4023 | 4060 | | |
4024 | 4061 | | |
| |||
4185 | 4222 | | |
4186 | 4223 | | |
4187 | 4224 | | |
| 4225 | + | |
4188 | 4226 | | |
4189 | 4227 | | |
4190 | 4228 | | |
| |||
4197 | 4235 | | |
4198 | 4236 | | |
4199 | 4237 | | |
| 4238 | + | |
4200 | 4239 | | |
4201 | 4240 | | |
4202 | 4241 | | |
| |||
Lines changed: 54 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
101 | 155 | | |
102 | 156 | | |
103 | 157 | | |
| |||
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
677 | 691 | | |
678 | 692 | | |
679 | 693 | | |
| |||
2201 | 2215 | | |
2202 | 2216 | | |
2203 | 2217 | | |
2204 | | - | |
| 2218 | + | |
2205 | 2219 | | |
2206 | 2220 | | |
2207 | 2221 | | |
| |||
2339 | 2353 | | |
2340 | 2354 | | |
2341 | 2355 | | |
2342 | | - | |
| 2356 | + | |
2343 | 2357 | | |
2344 | 2358 | | |
2345 | 2359 | | |
| |||
3011 | 3025 | | |
3012 | 3026 | | |
3013 | 3027 | | |
| 3028 | + | |
3014 | 3029 | | |
3015 | 3030 | | |
3016 | 3031 | | |
| |||
3144 | 3159 | | |
3145 | 3160 | | |
3146 | 3161 | | |
| 3162 | + | |
3147 | 3163 | | |
3148 | 3164 | | |
3149 | 3165 | | |
| |||
3160 | 3176 | | |
3161 | 3177 | | |
3162 | 3178 | | |
| 3179 | + | |
3163 | 3180 | | |
3164 | 3181 | | |
3165 | 3182 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
321 | 322 | | |
322 | 323 | | |
323 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
324 | 328 | | |
325 | 329 | | |
326 | 330 | | |
| |||
763 | 767 | | |
764 | 768 | | |
765 | 769 | | |
| 770 | + | |
766 | 771 | | |
767 | 772 | | |
768 | 773 | | |
| |||
2671 | 2676 | | |
2672 | 2677 | | |
2673 | 2678 | | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
2674 | 2687 | | |
2675 | 2688 | | |
2676 | 2689 | | |
| |||
2719 | 2732 | | |
2720 | 2733 | | |
2721 | 2734 | | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
2722 | 2740 | | |
2723 | 2741 | | |
2724 | 2742 | | |
| |||
0 commit comments