I am trying to print the output from a spark session sql query to a txt file using the following code: rd is a list of items I am trying to query
for item in