Unable to write as ORC file


I have created orders DF and then created a temp table . I am using the below DF to write output as ORC but getting error message that ORC data source can only be used wit hivecontext.

sqlContext.sql(“select * form orders limit 10”).write.orc(“user/ubuntuaws/orders_orc”)

Does these mean spark SQL Dataframes cannot be saved as ORC? Please assist.

Yes. ORC file format is one of the primary file format supported by Hive. So, It can be done only with sqlContext pointing to HiveContext.