-
Notifications
You must be signed in to change notification settings - Fork 62
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
Invalid argument error #336
Comments
I can can reproduce here on Windows. Cannot write arrow to the same filepath which was previously read from. |
The issue wan't OS / Windows specific as the above example crashed Julia session on Ubuntu. using Arrow
using DataFrames
df = DataFrame(rand(100, 100), :auto)
Arrow.write("test.arrow", df)
df = copy(DataFrame(Arrow.Table("test.arrow")))
Arrow.write("test.arrow", df) |
|
I forgot to As @jeremiedb mentioned, you can overwrite the loaded arrow file on Linux if it's copied, but the same code will raise an error on Windows. A temporary workaround from JuliaData/CSV.jl#170 is to use |
|
@TanookiToad - this is strange |
Yeah. I was wrong about that. There's actually no difference in For example, the following code will work if df = copy(DataFrame(Arrow.Table("test.arrow")))
Arrow.write("test.arrow", df) I've tested it with Julia v1.6.7, v1.7.2 and v1.8.2 (64-bit) on Win11 2H22. All of them have the same results. |
Should fix #336. For more context, see the [same fix](JuliaData/CSV.jl@077e177) we made for this in CSV.jl. Basically, objects interpolated into or returned from spawned tasks can be unexpectedly kept alive long after the task has finished and the object should have been garbage-collected due to individual threads holding the most recent task as a reference. Using `@wkspawn` ensures tasks themselves don't hold references to any of these once they're done executing.
Fix for this is up: #469. Sorry for the slow response here, but it would be great if anyone on windows could confirm that the original issue is fixed w/ that PR. |
Should fix #336. For more context, see the [same fix](JuliaData/CSV.jl@077e177) we made for this in CSV.jl. Basically, objects interpolated into or returned from spawned tasks can be unexpectedly kept alive long after the task has finished and the object should have been garbage-collected due to individual threads holding the most recent task as a reference. Using `@wkspawn` ensures tasks themselves don't hold references to any of these once they're done executing.
If you try to save a loaded table into the same file, it will lead to an invalid argument error.
Seems like it's caused by mmap on windows. See JuliaData/CSV.jl#170.
The last line will raise an error.
However, it works when saved under a different file name other than the original one.
The text was updated successfully, but these errors were encountered: