I have the following code which fires hiveContext.sql()
most of the time. My task is I want to create few tables and insert values into after processing for all
This is my assumption: you must be having limited executors on your cluster and job might be running in shared environment.
As you said, your file size is small, you can set a smaller number of executors and increase executor cores and setting the memoryOverhead
property is important here.
Using above property I am sure you will avoid any executor out of memory issues without compromising performance.