-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for collections #21
base: master
Are you sure you want to change the base?
Conversation
Add support for including frozen lists in generated changes. Made necessary changes to support nested data types.
Add support for including frozen sets in generated changes.
Add support for including frozen maps in generated changes.
Add support for including tuples in generated changes. For a tuple, a Kafka Connect struct is created with "tuple_member_*" for each member of a tuple (as they can have different data types inside).
Add support for including frozen UDTs in generated changes.
Now that I think of it, maybe it's redundant to have "REMOVE" mode and removals should be represented as setting to null (as is currently the case for UDT)? Then we would have 2 modes, let's say "UPDATE" and "OVERWRITE", the difference between them would be whether the collection is cleared before operation. |
I don't see how it would work for sets? |
Opinion: That would make the output record look cleaner and more like if you'd query Scylla directly. |
034d0d5
to
a4c715a
Compare
I pushed new version, with a bit different representation. Now, there are only 2 modes: I also renamed
Yes, that would of course be better, but is harder (as it requires preimage/postimage usage), and will be added in the future - that's why I added config option to select mode for non-frozen collections. |
I've tried rebasing (no significant changes were made) and running this change and there are two issues:
Since it's a rebased version here's relevant section of
@Lorak-mmk i see that there is an
I'll try to make it work and give next update if i find anything significant |
Also in Fix: allow null sets/maps/lists I don't see changes related to sets. Were they already ok and did not require fixing? |
I did not work with kafka for a fea years now. Could you write a list of step to set this up and reproduce the issue so I can debug it? |
Based on #12 and includes changes from it - so review should be done on per-commit base.
This PR adds simple support for non-frozen collections.
There is new config option
scylla.collections.mode
, currently only possible value is "simple" - it selects format for non-frozen collections (in the future we could add preimage etc).Simple mode collections format is described in README.md (along with frozen collections format). Just to give very brief description: non-frozen collections are represented as structs with 2 fields, "mode" and "elements", "mode" marks type of operation (add elements, remove elements, overwrite collection), "elements" are actual elements used in operation.
For
Set
, "elements" is simply aSet
.List
is a map withtimeuuid
key type. When removing elements, values are null.Map
is simply aMap
. When removing elements, values are null.UDT
is the most complicated. It is represented as struct, but each field is aCell
, and semantics are the same as with column's "Cell" - null means no change, non-null with nullvalue
field means removal, non-null with non-nullvalue
field means new value.I didn't yet test it with Avro.