-
Notifications
You must be signed in to change notification settings - Fork 46
feat: Initial ALTREP support for LIST logical type
#77
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
Conversation
krlmlr
left a comment
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.
Thanks, nice! Can you please add a test?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files☔ View full report in Codecov by Sentry. |
|
Will do. I just need to make the use case I started from independent of Created on 2024-02-22 with reprex v2.1.0 |
|
Try this: I have infrastructure to generate those. |
|
Even simpler: |
|
In a duckdb test, we don't need |
|
I added a test in |
krlmlr
left a comment
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.
Tests now fail if ALTREP is not supported. Can you please add conditional compilation?
| df1 <- tibble::tibble(a = list(1, c(1,2))) | ||
|
|
||
| rel1 <- rel_from_df(con, df1) | ||
| rel2 <- rel_filter(rel1, list(expr_constant(TRUE))) |
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.
Thanks, sorry for the confusion. I'm not sure we even need the filter here for the roundtrip, but it doesn't hurt.
krlmlr
left a comment
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, thanks!
LIST logical type
|
Thanks! |
This uses the same approach as with alters strings, i.e.
Elt()materialise all withVECTOR_ELT(AltrepVectorWrapper::Get(x)->Vector(), i);there is probably a better way involving not forcing materialisation, i.e. an
Elt()method that would just callduckdb_r_transform(chunk.data[column_index], dest, dest_offset, chunk.size(), false);