'Read CSV file on Spark

I am started working with Spark and found out one problem. I tried reading CSV file using the below code:

df = spark.read.csv("/home/oybek/Serverspace/Serverspace/Athletes.csv")
df.show(5)

Error:

Py4JJavaError: An error occurred while calling o38.csv.
: java.lang.OutOfMemoryError: Java heap space

I am working in Linux Ubuntu, VirtualBox:~/Serverspace.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source