-
Notifications
You must be signed in to change notification settings - Fork 2k
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
R: Full support of lists and structs in R #8503
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Would just like to see more test cases for other types.
If I'm not mistaken, nested types are registered per every nested child object?
|
||
private: | ||
RTypeId id_; | ||
child_list_t<RType> aux_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does aux_ stand for in this case? Just auxiliary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, auxiliary information. Can you think of a better name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe child_Rtypes
? auxiliary feels to broad to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aux_
holds the list child type, struct child types and names, or factor levels. It's really a union type, but luckily everything fits into the child_list_t
. Could be extra_
, or perhaps child_types_or_enum_levels_
, or a proper virtual base class with subclasses (but then how do we name that member?).
Can you please rephrase? |
I'll follow up with more tests. |
I'm not too sure about my usage of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was trying to test around and it seems like the following fails
df <- vctrs::data_frame(a = 1:4, b = list(4:6, 2:3, 1L, 5))
dbWriteTable(con, "df", df)
while
df <- vctrs::data_frame(a = 1:4, b = list(4:6, 2:3, 1L, 5L))
dbWriteTable(con, "df", df)
The error is Error: rapi_execute: Can't convert R type
. I know that all nested structs/lists need the same type, but I think the user would appreciate feedback in this case that we don't yet support two types in the same nested object.
Might also be nice to have a RTypeToString() method for debugging? Possibly also for the above mentioned case?
Should we also test nested lists/structs that have above the default chunk size?
Your usage of |
Can you please construct a data frame that would exceed the chunk size limits? Happy to tackle the detailed comments in a follow-up PR. The vctrs package in R also has a |
Yea, I think a follow up PR would be fine, this looks good to me. |
Looks good to me, can we maybe now remove some of the excludes in test_types.R? |
Absolutely. Can we do that in a follow-up PR? |
(FWIW, |
Co-authored-by: Kirill Müller <kirill@cynkra.com>
R: Full support of lists and structs in R
R: Full support of lists and structs in R
R: Full support of lists and structs in R
- Merge pull request duckdb/duckdb#8378 from Mytherin/enumcatalogremoval: Format serialization - add missing serialization logic for DelimJoin, AsOfJoin, CreateIndex and enums - Merge pull request duckdb/duckdb#8503 from krlmlr/f-2841-nested - Merge pull request duckdb/duckdb#8626 from carlopi/fixR: R: Fix warning on mismatched integer comparison
- Merge pull request duckdb/duckdb#8378 from Mytherin/enumcatalogremoval: Format serialization - add missing serialization logic for DelimJoin, AsOfJoin, CreateIndex and enums - Merge pull request duckdb/duckdb#8503 from krlmlr/f-2841-nested - Merge pull request duckdb/duckdb#8626 from carlopi/fixR: R: Fix warning on mismatched integer comparison
This adds support for lists of atomic vectors. All elements must be of the same type for this to work. The commits make sense individually, but mostly depend on each other.
ALTREP support can be built on top of that.
Closes #2841.