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

[R] Cannot write parquet to OutputStream #23935

Closed
asfimport opened this issue Jan 27, 2020 · 4 comments
Closed

[R] Cannot write parquet to OutputStream #23935

asfimport opened this issue Jan 27, 2020 · 4 comments

Comments

@asfimport
Copy link

The R package does not allow for the ability to write to a FileOutputStream. 

Minimal testing code:
library(arrow)
tf1 <- arrow::FileOutputStream$create(path = "output.parquet")
arrow::write_parquet(data.frame(x = 1:5), tf1)

Throws error:

Error in inherits(sink, OutputStream) : 'what' must be a character vector

 

The issue appears to be in line 153 of parquet.R

if (is.character(sink)) {
sink <- FileOutputStream$create(sink)
on.exit(sink$close())
} else if (!inherits(sink, OutputStream)) {
abort("sink must be a file path or an OutputStream")
}

 

Should be !inherits(sink,'OutputStream')

Reporter: Bob / @bob-skowron
Assignee: Bob / @bob-skowron

PRs and other links:

Note: This issue was originally created as ARROW-7690. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Francois Saint-Jacques / @fsaintjacques:
Thanks for reporting this. Meanwhile you can hotfix this by copying a version of write_parquet and quoting "OutputStream"

@asfimport
Copy link
Author

Neal Richardson / @nealrichardson:
Good catch! Would you like to submit a PR to fix that?

@asfimport
Copy link
Author

Bob / @bob-skowron:
Yeah, I can submit a PR in just a bit here.

@asfimport
Copy link
Author

Neal Richardson / @nealrichardson:
Issue resolved by pull request 6304
#6304

@asfimport asfimport added this to the 0.16.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant