-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-13852: [R] Handle Dataset schema metadata in ExecPlan #11183
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
ea1cd73 to
6f013f6
Compare
jonkeane
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.
This looks good — one comment about messaging if we do encounter non-R metadata it would be nice to at least flag that something is getting lost
| if (ncol(tab)) { | ||
| # Apply any column metadata from the original schema, where appropriate | ||
| original_schema <- source_data(.data)$schema | ||
| # TODO: do we care about other (non-R) metadata preservation? |
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.
Could we detect that it is there and warn/message that we've discarded it? It might be a little bit confusing, but I think that would be preferable to "Arrow lost all my metadata!"
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.
We already do discard other metadata when you convert from Arrow to R. Check out the example parquet file in inst/, for example: it has "pandas" metadata. I suspect it would be more surprising/alarming if we started messaging about this metadata all of the sudden.
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.
Hmm, Arrow to R conversion losing the metadata sounds like what I expected. TBH I am a little surprised that the following happens silently, since the tab below does have the pandas metadata there. Though that's been in Arrow for a while and if no one has complained, I guess it's not that important.
> tab <- read_parquet(system.file("v0.7.1.parquet", package = "arrow"), as_data_frame = FALSE)
>
> dplyr::select(tab, carat)$metadata
NULL
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.
Actually, on 5.0:
new <- tab %>%
select(carat) %>%
compute()
new$metadata
$pandas
[1] "{\"index_columns\": [\"__index_level_0__\"], \"column_indexes\": [{\"name\":
...
I still don't think this is necessarily meaningful--especially when you're dealing with multiple files with potentially different metadata.
Closes apache#11183 from nealrichardson/exec-plan-metadata Authored-by: Neal Richardson <neal.p.richardson@gmail.com> Signed-off-by: Neal Richardson <neal.p.richardson@gmail.com>
No description provided.