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] crashes when reading empty feather with POSIXct column #29880

Closed
asfimport opened this issue Oct 13, 2021 · 3 comments
Closed

[R] crashes when reading empty feather with POSIXct column #29880

asfimport opened this issue Oct 13, 2021 · 3 comments
Assignees
Milestone

Comments

@asfimport
Copy link

asfimport commented Oct 13, 2021

R crashes when writing and then reading an empty feather with at least one POSIXct column.

# Create empty df with one POSIXct column
dates <- as.POSIXct(character())
values <- numeric()
df_empty <- data.frame(dates, values)

df_empty
# [1] dates  values
# <0 rows> (or 0-length row.names)

sapply(df_empty, class)
# $dates
# [1] "POSIXct" "POSIXt" 
#
# $values
# [1] "numeric"

# Write and read -> R crashes
tempfile <- tempfile()
arrow::write_feather(df_empty, tempfile)

df_restored <- arrow::read_feather(tempfile)
# >> R crashes here. Tested on 3.6.3 & 4.1.1 for windows and Linux.

unlink(tempfile)

At times, in RStudio, this message is displayed when R crashes.
image-2021-10-13-10-35-33-643.png  
 

Tested on Windows (R version 3.6.3 and 4.1.1) and Linux (R 3.6.3). 

# TESTED ON WINDOWS 
Arrow5.0.0.2R version 3.6.3 (2020-02-29) 
Platform: x86_64-w64-mingw32/x64 (64-bit) 
Running under: Windows 10 x64 (build 19043)

R version 4.1.1 (2021-08-10) 
Platform: i386-w64-mingw32/i386 (32-bit) 
Running under: Windows 10 x64 (build 19043)

# TESTED ON LINUX 
Arrow5.0.0.2R version 3.6.3 (2020-02-29) 
Platform: x86_64-pc-linux-gnu (64-bit) 
# Running under: Debian GNU/Linux 10 (buster)

Reporter: Damiano
Assignee: Neal Richardson / @nealrichardson

Related issues:

Original Issue Attachments:

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

@asfimport
Copy link
Author

Neal Richardson / @nealrichardson:
Thanks for the report. This sounds like ARROW-13761, which has been fixed but not yet released. Would you mind installing a nightly build of the package (https://arrow.apache.org/docs/r/#installing-a-development-version) and confirming that it's fixed for you?

@asfimport
Copy link
Author

Neal Richardson / @nealrichardson:
I ran your code and it seems fixed for me:

> df_restored
[1] dates  values
<0 rows> (or 0-length row.names)

@asfimport
Copy link
Author

Damiano:
Brilliant.

Yes, I confirm that in the nightly build it works. Thanks.

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

2 participants