Spark write to memory error

I have a data frame for a streaming job created as shown below

purchase_by_hour = retail_stream.selectExpr("CustomerId",
"(UnitPrice * Quantity) as total_cost",
"InvoiceDate") \
.groupBy(col("CustomerId"),window(col("InvoiceDate"),"1 day")) \

But, when I try to write it as a stream, as shown in the snippet below, I get a ‘Permission denied’ error.



Py4JJavaError: An error occurred while calling o87.start.
: Permission denied: user=itv654347, access=WRITE, inode="/tmp":hdfs:supergroup:drwxrwx--x