Giter Site home page Giter Site logo

Comments (7)

EnricoMi avatar EnricoMi commented on May 22, 2024

Minor optimization:

Instead of

a_frame.diff(b_frame).where("diff != 'N'").count() == 0

you could do

not a_frame.diff(b_frame).where("diff != 'N'").isEmpty()

Because the former makes Spark compute the entire diff in order to return the count.
The latter makes Spark stop computing the diff once a single non-N row is found.

from spark-extension.

EnricoMi avatar EnricoMi commented on May 22, 2024

It looks like your a_frame and b_frame are single-partition dataframes. This means that Spark has all the data in a single executor, which runs out of memory with sufficiently many rows. Add more workers does not help then.

Try adding a .repartition(100) behind load().

from spark-extension.

bobhaffner avatar bobhaffner commented on May 22, 2024

Thanks, @EnricoMi ! I'll try out your suggestions

from spark-extension.

bobhaffner avatar bobhaffner commented on May 22, 2024

Hello! I tried not a_frame.diff(b_frame).where("diff != 'N'").isEmpty() and I tried a few Ns for the .repartition(), but no luck unfortunately. Any other suggestions are much appreciated!

from spark-extension.

EnricoMi avatar EnricoMi commented on May 22, 2024

Can you go to the Spark UI -> SQL tab -> click on the job that fails. If you could save that HTML page or screenshot it, that would help a lot. That page looks like this:

grafik

Also useful is the Executors tab and the Stages tab (click on the stage that fails).

Does .count() behind .load() work at all for over 10m rows?

from spark-extension.

bobhaffner avatar bobhaffner commented on May 22, 2024

So I stumbled across something...

Setting a fetchsize (eg.option("fetchsize","100000")) in the JDBC config allows me to successfully perform the subsquent diff on two 21M dataframes

from spark-extension.

EnricoMi avatar EnricoMi commented on May 22, 2024

So looks like this is unrelated to spark-extension and solved. Closing.

from spark-extension.

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.