I was going through Hadoop and Spark documentation to understand how spark works on Hadoop cluster. According to Hadoop documentation, Hadoop cluster is a group of commodity hardware with computation and data storage capacity, and also they assume "Moving computation is cheaper than moving data".
Now, when I process a large file which is stored on HDFS using Spark. Will Spark redistribute data in this file to Hadoop cluster randomly or it is aware of the nodes where data partitions are stored will ask the respective nodes to process their data? I got this question as there was no mention regarding how spark handles data partitions on Hadoop cluster.
And If spark redistributes the data, what is the logic behind having this overhead of redistribution?