Giter VIP home page Giter VIP logo

Comments (8)

Tom-Deng avatar Tom-Deng commented on July 28, 2024 1

It may be easier if you just run db-benchmark script having data source replaced and compare timings.
Caching data in memory,the performance of csv and parquet is indeed similar in db-benchmark's scense.

from db-benchmark.

jangorecki avatar jangorecki commented on July 28, 2024

Do you mean that Spark is not dealing well with CSV data?
It loads the data into memory so CSV is just a source for data. Later on spark operates on an in-memory object and not the CSV.

from db-benchmark.

Tom-Deng avatar Tom-Deng commented on July 28, 2024

Do you mean that Spark is not dealing well with CSV data? It loads the data into memory so CSV is just a source for data. Later on spark operates on an in-memory object and not the CSV.
Spark has specifically optimized parquet files. Take q1 of 5G data groupby operation as an example,spark processing csv dataset takes 8.42s on average. but spark processing parquet dataset takes 555ms on average.
csv data:
image
parquet data:
image

from db-benchmark.

jangorecki avatar jangorecki commented on July 28, 2024

Thanks for investigation. You should try to cache data in memory before running first query, as we do in benchmark script. As of now your code is probably including time to load data from csv in the time of query.

from db-benchmark.

Tom-Deng avatar Tom-Deng commented on July 28, 2024

Thanks for investigation. You should try to cache data in memory before running first query, as we do in benchmark script. As of now your code is probably including time to load data from csv in the time of query.
Refer to the suggestions above,I try to cache data in memory before running first query,but the result is basically the same.
image

from db-benchmark.

jangorecki avatar jangorecki commented on July 28, 2024

I don't think that your code caches data in memory. Spark interface is lazy and AFAIR calling persist alone does not force computation.

from db-benchmark.

Tom-Deng avatar Tom-Deng commented on July 28, 2024

I don't think that your code caches data in memory. Spark interface is lazy and AFAIR calling persist alone does not force computation.

See my code in the attachment, you can take a look at it as a whole.
spark_csv_vs_parquet.ipynb.zip

from db-benchmark.

jangorecki avatar jangorecki commented on July 28, 2024

It may be easier if you just run db-benchmark script having data source replaced and compare timings.

from db-benchmark.

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.