Code Monkey home page Code Monkey logo

Comments (4)

quinnj avatar quinnj commented on July 1, 2024

No, currently GZip streams are not supported. They were at one point, but they ended up being a total performance trap (like 1000x slower than just unzipping the file beforehand). So for now, the recommended approach is to unzip your file beforehand then parse it.

To ultimately support GZip, we need to do an overhaul of the GZip/Libz packages to combine the best of each. Currently, GZip sucks for performance, but supports file-based operations, while Libz is fast, but only supports stream-based operations. It's on my TODO list.

from csv.jl.

tpapp avatar tpapp commented on July 1, 2024

Apparently https://github.com/BioJulia/Libz.jl addresses (or plans to address) the same problems (but still gives the same error message). Perhaps it would be easier to make CSV work with that?

from csv.jl.

tpapp avatar tpapp commented on July 1, 2024

Unfortunately decompression is cumbersome, the multiple CSV files are about 1GB each and gzip -9 gives me a factor of 10-15. I have enough space, but the server is HDD-based so everything is so much faster with gzipped files.

from csv.jl.

quinnj avatar quinnj commented on July 1, 2024

Reading gzipped files is now supported via Libz.jl package, like

julia> f = ZlibInflateInputStream(open(joinpath(dir, "test_basic.csv.gz")))
BufferedStreams.BufferedInputStream{Libz.Source{:inflate,BufferedStreams.BufferedInputStream{IOStream}}}(<8.0 KiB buffer, 0% filled>)

julia> df = CSV.read(f)
3×3 DataFrames.DataFrame
│ Row │ col1 │ col2 │ col3 │
├─────┼──────┼──────┼──────┤
│ 1123    │
│ 2456    │
│ 3789

from csv.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.