Skip to content
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

Add documentation on how to use ehrql's arrow files in R #2244

Open
rebkwok opened this issue Nov 21, 2024 · 2 comments
Open

Add documentation on how to use ehrql's arrow files in R #2244

rebkwok opened this issue Nov 21, 2024 · 2 comments

Comments

@rebkwok
Copy link
Contributor

rebkwok commented Nov 21, 2024

An ehrql-generated arrow file needs to be read in a specific way in R. We should document this somewhere:

This results in a "not a valid feather file" error.

library(dplyr)

ehrql_data <- feather::read_feather(here::here("output", "dataset.arrow"))

This is fine:

library(arrow)

ehrql_data <- read_feather(here::here("output", "dataset.arrow"))

An ehrql-generated arrow file is also read fine as a feather file by pyarrow:

import pyarrow.feather as ft
ft.read_table("dataset.arrow")
@evansd
Copy link
Contributor

evansd commented Nov 27, 2024

I suspect this is related to the Feather v1 vs v2 formats – this confusion is, I think, why the Feather v2 format ended up being renamed to just Arrow.

The read_feather function from the arrow package can read either format:

read_feather() can read both the Feather Version 1 (V1), a legacy version available starting in 2016, and the Version 2 (V2), which is the Apache Arrow IPC file format. read_ipc_file() is an alias of read_feather().

The feather package itself is abandoned:
https://github.com/wesm/feather

@inglesp
Copy link
Contributor

inglesp commented Dec 11, 2024

Add note here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants