TanookiToad opened a new issue, #336:
URL: https://github.com/apache/arrow-julia/issues/336

   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#70.
   
   ```jl
   using Arrow
   using DataFrames
   
   df = DataFrame(rand(100, 100), :auto)
   Arrow.write("test.arrow", df)
   
   df = Arrow.Table("test.arrow")
   Arrow.write("test.arrow", df)
   ```
   
   The last line will raise an error. 
   
   ```jl
   ERROR: SystemError: opening file "test.arrow": Invalid argument
   Stacktrace:
     [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
       @ Base .\error.jl:174
     [2] #systemerror#68
       @ .\error.jl:173 [inlined]
     [3] systemerror
       @ .\error.jl:173 [inlined]
     [4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, 
create::Nothing, truncate::Bool, append::Nothing)
       @ Base .\iostream.jl:293
     [5] open(fname::String, mode::String; lock::Bool)
       @ Base .\iostream.jl:355
     [6] open(fname::String, mode::String)
       @ Base .\iostream.jl:355
     [7] open(::Arrow.var"#116#117"{Nothing, Nothing, Bool, Nothing, Bool, 
Bool, Bool, Int64, Int64, Float64, Bool, Arrow.Table}, ::String, 
::Vararg{String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), 
Tuple{}}})
       @ Base .\io.jl:328
     [8] open(::Function, ::String, ::String)
       @ Base .\io.jl:328
     [9] #write#115
       @ C:\Users\R9000K\.julia\packages\Arrow\SFb8h\src\write.jl:57 [inlined]
    [10] write(file_path::String, tbl::Arrow.Table)
       @ Arrow C:\Users\R9000K\.julia\packages\Arrow\SFb8h\src\write.jl:57
    [11] top-level scope
       @ Untitled-1:8
   ```
   
   However, it works when saved to a different file name other than the 
original one.
   
   ```jl
   Arrow.write("test1.arrow", df)
   ```
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to