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

read_fst() checks for incomplete fst files #254

Open
j-kreis opened this issue Feb 3, 2021 · 3 comments
Open

read_fst() checks for incomplete fst files #254

j-kreis opened this issue Feb 3, 2021 · 3 comments
Assignees
Milestone

Comments

@j-kreis
Copy link

j-kreis commented Feb 3, 2021

I am running R on a Mac with a M1 chip.

When I use the following code chunk R crashes with a 'floating point exception':

q = fst::fst("large_file.fst")
q = q[1:2000,]

Reading smaller chunks of the fst works fine.

@MarcusKlik MarcusKlik self-assigned this Mar 4, 2021
@MarcusKlik MarcusKlik added the bug label Mar 4, 2021
@MarcusKlik MarcusKlik added this to the fst v0.9.6 milestone Mar 4, 2021
@MarcusKlik
Copy link
Collaborator

MarcusKlik commented Mar 4, 2021

Hi @ticarki, thanks for reporting!

It's hard to pinpoint the exact problem without the actual data. Does the following code lead to an identical error on your M1 chip?

dt <- data.frame(
    A = 1:1000,
    B = 1.1:10000.1
  )

path <- tempfile(".fst")
fst::write_fst(dt, path)

head(fst::fst(path)[1:2000, 1:2])
#>   A   B
#> 1 1 1.1
#> 2 2 2.1
#> 3 3 3.1
#> 4 4 4.1
#> 5 5 5.1
#> 6 6 6.1

also, what endianness is the M1 chip?

# on intel/AMD
.Platform$endian
#> [1] "little"

thanks

@j-kreis
Copy link
Author

j-kreis commented Mar 4, 2021

Hi @MarcusKlik, thanks for your answer! Blame on me, I probably used an incomplete fst file. Would it be possible to add a check for that? Not relevant anymore, but .Platform$endian returns "little"

@j-kreis j-kreis closed this as completed Mar 4, 2021
@MarcusKlik
Copy link
Collaborator

Hi @ticarki, thanks for reporting back. Yes, adding a check for incomplete files would definitely add to the stability of fst. I will change the title of your issue and change it to a feature request!

@MarcusKlik MarcusKlik changed the title floating point exception read_fst() checks for incomplete fst files Mar 4, 2021
@MarcusKlik MarcusKlik reopened this Mar 4, 2021
@MarcusKlik MarcusKlik modified the milestones: fst v0.9.6, fst v0.9.10 Nov 16, 2022
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