09-16-2021 02:08 PM
Hello everyone,
I am facing performance issue while calculating cosine similarity in pyspark on a dataframe with around 100 million records.
I am trying to do a cross self join on the dataframe to calculate it.
The executors are all having same number of tasks when seen on the spark ui.
The input size to all executors is also almost the same.
Executors : 20
Cores: 4 cores
Any inputs would be highly appreciated
09-22-2021 02:41 PM
The issue is probably related to the self join between 100 million rows, I'm not positive without seeing the code and understanding the problem better but you may want to think about using windowing functions instead
https://blog.knoldus.com/using-windows-in-spark-to-avoid-joins/
09-16-2021 09:30 PM
Hi @ Databricks2005! My name is Kaniz, and I'm the technical moderator here. Great to meet you, and thanks for your question! Let's see if your peers on the community have an answer to your question first. Or else I will follow up with my team and get back to you soon.Thanks.
09-17-2021 02:35 AM
Thank you Kaniz !. I shall wait for an answer 🙂
09-22-2021 02:41 PM
The issue is probably related to the self join between 100 million rows, I'm not positive without seeing the code and understanding the problem better but you may want to think about using windowing functions instead
https://blog.knoldus.com/using-windows-in-spark-to-avoid-joins/
10-01-2021 10:00 AM
Is there a way to hash the record attributes so that the cartesian join can be avoided? I work on record similarity and fuzzy matching and we do a learning based blocking alorithm which hashes the records into smaller buckets and then the hashes are joined. You can check https://github.com/zinggAI/zingg for the approach.