SparkR Error creating instance of 'org.apache.spark.sql.hive.HiveSessionState'

I install SparkR on my Windows 8.1 from this tutorial https://www.linkedin.com/pulse/setting-up-sparkr-windows-machine-ramabhadran-kapistalam . I ended up like this, I think it is well implemented. The problem is that I am trying to run the example with a simple Data Frame:

Error in handleErrors(returnStatus, conn) : 
  java.lang.IllegalArgumentException: Error while instantiating 'org.apache.spark.sql.hive.HiveSessionState':
    at org.apache.spark.sql.SparkSession$.org$apache$spark$sql$SparkSession$$reflect(SparkSession.scala:981)
    at org.apache.spark.sql.SparkSession.sessionState$lzycompute(SparkSession.scala:110)
    at org.apache.spark.sql.SparkSession.sessionState(SparkSession.scala:109)
    at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:62)
    at org.apache.spark.sql.SparkSession.createDataFrame(SparkSession.scala:552)
    at org.apache.spark.sql.SparkSession.createDataFrame(SparkSession.scala:307)
    at org.apache.spark.sql.api.r.SQLUtils$.createDF(SQLUtils.scala:139)
    at org.apache.spark.sql.api.r.SQLUtils.createDF(SQLUtils.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at

This is my code in R:

 Sys.setenv(SPARK_HOME = "C:/Spark/spark-2.1.1-bin-hadoop2.7")
 .libPaths(c(file.path(Sys.getenv("SPARK_HOME"),"R","lib"), .libPaths()))
 sparkR.session(appName = "SparkR-DataFrame-example")
 df <- as.DataFrame(faithful)

And I saw a solution that I had to configure for a sparkr session, adding:

sparkR.session(master = "local[*]", sparkConfig = list(spark.driver.memory = "1g", spark.sql.warehouse.dir = "file:///somelocaldirectory"))

I tried editing the spark.sql.warehouse.dir file with the data file, but the error persisted

+4
source share
1 answer

, R-studio R, .

, R-studio R run as administrator, .

+2

Source: https://habr.com/ru/post/1676386/


All Articles