Why does spark-shell fail with "The root scratch dir: /tmp/hive on HDFS should be writable."?

As per the error message:

Caused by: java.lang.RuntimeException: The root scratch dir: /tmp/hive on HDFS should be writable. Current permissions are: ---------
  at org.apache.hadoop.hive.ql.session.SessionState.createRootHDFSDir(SessionState.java:612)
  at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:554)
  at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:508)
  ... 85 more

You should change the permissions of C:\tmp\hive directory as follows:

winutils.exe chmod -R 777 C:\tmp\hive