1

I have created a dataset of type Row as below,

Dataset<Row> databaseDs = sparkSession.createDataFrame(dbStatus, Status.class);

I want to convert this to Excel sheet so I used below code for Excel conversion

databaseDs.write()
    .format("com.crealytics.spark.excel")
    .option("useHeader", "true")
    .option("treatEmptyValuesAsNulls", "true")
    .option("inferSchema", "true")
    .option("addColorColumns", "false").mode("overwrite").save("C:\\resultset.xlsx");

But I am getting

ChangeFileModeByMask error (5): Access is denied

How to resolve this issue as I have the permission to write to c: folder and still empty files ".resultset.xlsx.crc" and "resultset.xlsx" with 0kb

baitmbarek
  • 2,440
  • 4
  • 18
  • 26
  • You dont have permission write under the C folder. Change the path to some other drive or mention hadoop user as part of system . Make sure the user mentioning can have write access or create a folder under c and provide all permission to that folder and write under it – Abdul Jul 18 '18 at 13:36
  • org.apache.hadoop.util.Shell$ExitCodeException: ChangeFileModeByMask error (5): Access is denied. I am still getting the error after creating new folder and giving all permissions. how to create hadoop user as part of system? – theAverageCoder Jul 18 '18 at 14:00
  • Please try this https://stackoverflow.com/questions/36168135/running-spark-on-windows-error-5-access-denied-even-when-running-as-admin – Abdul Jul 18 '18 at 14:07
  • tried with no luck... :::::::::::( – theAverageCoder Jul 18 '18 at 14:26

0 Answers0