Repository navigation
destination-snowflake: truncate large records - #45431
Stephane Geneix (stephane-airbyte) merged 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join Stephane Geneix (@stephane-airbyte) and the rest of your teammates on |
eb88eff to
36f59f1
Compare
21c91c5 to
10105cc
Compare
36f59f1 to
69bf741
Compare
10105cc to
83e2dda
Compare
69bf741 to
cbd1334
Compare
83e2dda to
88fd78e
Compare
cbd1334 to
0005abc
Compare
88fd78e to
1601c23
Compare
0005abc to
2d22e6f
Compare
1601c23 to
a607474
Compare
daabc9b to
b9352bf
Compare
ab4981b to
36ff551
Compare
b9352bf to
29afc32
Compare
36ff551 to
ef8ca17
Compare
29afc32 to
b0f2e94
Compare
ef8ca17 to
8ceef31
Compare
b0f2e94 to
ef3275f
Compare
8ceef31 to
d9e641e
Compare
ef3275f to
55a3739
Compare
90c1a66 to
c35540c
Compare
55a3739 to
442a24b
Compare
c7beaee to
b07ca08
Compare
442a24b to
4b3f6f3
Compare
b07ca08 to
e65acb4
Compare
4b3f6f3 to
da7e4ba
Compare
e65acb4 to
afe55f2
Compare
da7e4ba to
9284182
Compare
afe55f2 to
5e9b9c1
Compare
9284182 to
695511d
Compare
5e9b9c1 to
1a20860
Compare
695511d to
25ccb81
Compare
1a20860 to
05cc92b
Compare
25ccb81 to
45b9a08
Compare
Johnny Schmidt (johnny-schmidt)
left a comment
There was a problem hiding this comment.
Makes sense
1 remove the primary key fields, totaling their size; add them to final data
2 sort the remaining by size ascending
3 keep adding them to the final data until we hit the limit, then start nulling and tracking changes
Questions:
- where does this limit come from
16 * 1_024 * 1_024?; does SF enforce that the string size of all the fields in a row be less than this? or is this to enforce serialization size in the raw table? - is this a hard limit? if so, what happens if the PK fields are too big (obviously unlikely); also, if this is for serialization size in the raw table, won't that size be larger due to the format? do the extra meta fields come into play? could the meta itself blow up if there were lots of fields past the limit
- this leaves the fields sorted by size, I assume that's okay? nothing downstream is dependent on field order (including tests)?
|
(declining this review, unless Stephane Geneix (@stephane-airbyte) you want a third set of eyes here) |
There's a weird 16MB limit that's on the VARIANT type. It's weird because it's not exact. They say it's compressed size (so raw size could be bigger), but could be smaller because of overhead...
If the sum of PK fields is bigger than 16MB, we just try to insert the record anyways, and we'll fail then. Seemed like dying was the only right thing to do short of losing data
yeah, tests look at the json field names, they don't care about order. Neither do our T+D queries |

What
This change implements a large record truncation mechanism for the Snowflake destination connector to handle records exceeding Snowflake's 16MB row size limit.
How
User Impact
Users can now sync large records to Snowflake without encountering errors due to row size limitations. Fields may be truncated to fit within the 16MB limit, but primary keys are always preserved. Metadata is added to indicate which fields were affected.