Questions and answers
22 questions from the community, answered by the
author in
#book-of-the-week
on Slack.
-
Tim Becker asked
Good morning Jonathan Rioux, very interesting book! I have a few beginners questions.
-
Tim Becker asked
- When should I start using Spark? I mean how large should my dataset be? Does it make sense to start using Spark, if my dataset still fit into memory, but I expect the size to increase?
-
Tim Becker asked
- How much worse is the performance with pySpark if it used on a small dataset.
-
Tim Becker asked
- What are the advantages of using databriks?
-
Tim Becker asked
- If we want to train ML models using pySpark, does the model have to support distributed training?
-
Tim Becker asked
Thank you 🙂
-
adanai asked
Hello Jonathan, just the kind of book I am interested to read further on!
I have been using Python (pandas/sklearn) for small-medium data related tasks (analysis / ML) and it is the only programming language I have some amount of exposure to.
In order to get started and work further with PySpark, do I need to have some prerequisites in understanding the spark architecture in its native implementation for working with big data?
Also, what is the approach to be taken to work with the scala/java implementation in case the switch has to be made?
-
José Bastos asked
Hi Jonathan, books seems great. Here are my questions:
- What's the data type you struggle the most? And the one you have more fun with?
- What is the most common error/assumption people do when using PySpark and general ML pipelines?
- Best tip to make training more efficient?
Thank you for your time!
-
Asmita asked
Hi Jonathan Rioux, I have been working on simple projects as of now. Will this book be a good start for learning about PySpark? Also, are there any specific hardware requirements for running?
I read your message about transfirmations vs actions, but is it useful for someone who is leaarning from scratch and has no idea abojt PySpark and its workings?
-
WingCode asked
Hi Jonathan Rioux , thank you for doing this Q&A
1# How do you estimate the resources needed for a spark job? Is there a tool out there which looks at the volume of data with the spark code to determine the number of executors, cpu & memory needed? Or is it some rule of thumb and repeated iteration to tune out the best config?
-
WingCode asked
2# In spark local mode vs cluster mode (YARN) what are the advantages in terms of my job performance? Other than:
a. Data locality. If my RDD partition and HDFS block is on same node hence no shuffle
b. Reliability. If my local executor is flaky, then my whole job performance/reliability suffers. YARN -> multiple machine hence flaky node can be mitigated.
c. Vertical scaling limit. If I need very high memory, CPU counts which the cloud provider doesn't offer on single instance.
If I manually set num of partitions (via coalesce or repartition) in local mode I can make multiple tasks executing in parallel? Wouldn't this be faster than cluster mode?
-
WingCode asked
3# How significant is the overhead between using Scala for spark versus Python for spark (since Python data structures have to be converted to Scala datatypes) ? Is it worthwhile to convert frequently run Pyspark in production to Scala spark for performance & better resource utilisation?
-
WingCode asked
4# Do you think serverless Spark (https://cloud.google.com/solutions/spark (opens in a new tab)) is going to be the next big thing for data analysis & ML similar to managed Kubernetes engine? Do most of the orgs in your experience, run private Spark clusters or use some cloud offering (DataStax, Databricks)
-
Jonathan Rioux
Author of the book
Hi everyone!
As for memory usage, especially when I get to scale a cluster, I use this image to remind me of the cluster memory vs. the available memory. On top of this, remember that Spark will spill to disk (which is slower, but not catastrophic).
When scaling a cluster, I found that most people try to skimp on memory. If you plan on using TBs of data, it’s not silly to have a lot of RAM (depending on the operations/transformation/modelling), you won’t have fun if you total 500GB of RAM across your cluster.
-
Lavanya M K asked
Hi Jonathan Rioux
1. Which is the best tool to use pyspark for creating eda and data visualization? I usually use zeppelin to do this.
2. Is there any difference in terms of resources utilisation or speed between using scala-spark and pyspark?
-
Lavanya M K asked
3. How efficient is it to use spark UDFs to perform data processing?
-
Alexey Grigorev asked
I remember a few years ago Apache Zeppelin was getting some traction as a nice and easy way to do analytics with Spark. But I haven't heard about it for a while. Is it still used? What do you think about it?
-
WingCode asked
Hi Jonathan Rioux,
I had few more questions 🙂
#1 Is there any advantages using HDFS 3.X over HDFS 2.X with Spark?
-
WingCode asked
#2 Do you recommend any other profiling tool for OOS spark jobs other than the information we get through spark Web UI ?
-
WingCode asked
#3 Do you think users of Spark need to have some basic understanding of the internals to use it better compared to other data processing tools like Pandas, Numpy?
-
Doink asked
Alexey Grigorev I am seeing some wonderful discussions happening here, wondering if these discussions are saved in a separate document for future reference?
-
Hironori Sakai asked
Hi Jonathan Rioux . I have a question about dependency management for PySpark. When we need a library for a PySpark Job, then we may 1) install the library on all nodes or 2) submit all required library with `--py-files` option. I do not think that these options are realistic if the dependency is quite large. (e.g. install/update `spacy`. It requires around 30 libraries.)
My question is: what is the best approach to submitting a PySpark Job requiring a large dependency?
(If we use Scala, we do not have such a problem, because we can pack all needed packages in a JAR file.)
Want the whole story?
The answers above are the short version of Data Analysis with Python and PySpark.