Java.lang.OutOfMemoryException :Java heap space.
Resultset is having only 150 rows.Sometime it is throwing error on select value step some times on write to log step.
I have no experience with hive or spark so cannot advise on performance tuning but it appears to simply be a memory issue, so can you increase the memory alloted to PDI?
Right click on the spoon.bat or spoon.sh file (depending on your environment) and in there there should be memory values (usually under something like PENTAHO_DI_JAVA_OPTIONS). Change these to a higher number and see if your transformation will run (always restart PDI after changing these values)
Retrieving data ...