【问题标题】:Java error while loading files in sparklyr在 sparklyr 中加载文件时出现 Java 错误
【发布时间】:2017-04-04 16:19:36
【问题描述】:

我正在使用“sparklyr”包使用 R 开发 Spark。

在 sparklyr 中加载文件时出现以下错误:

我的代码是:

library(sparklyr)

sc <- spark_connect(master = "local", version = "2.0.1")

iris_tbl <- copy_to(sc, iris)

错误显示:

Error: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.apache.spark.sql.hive.client.IsolatedClientLoader.createClient(IsolatedClientLoader.scala:258)
    at org.apache.spark.sql.hive.HiveUtils$.newClientForMetadata(HiveUtils.scala:359)
    at org.apache.spark.sql.hive.HiveUtils$.newClientForMetadata(HiveUtils.scala:263)
    at org.apache.spark.sql.hive.HiveSharedState.metadataHive$lzycompute(HiveSharedState.scala:39)
    at org.apache.spark.sql.hive.HiveSharedState.metadataHive(HiveSharedState.scala:38)
    at org.apache.spark.sql.hive.HiveSharedState.externalCatalog$lzycompute(HiveSharedState.scala:46)

我试图找到/研究解决方案,但在任何其他网站上都没有找到确认解决方案。

【问题讨论】:

    标签: r apache-spark sparkr


    【解决方案1】:

    我在边缘节点的 Cloudera 集群中遇到了同样的错误。我仍然不清楚的地方似乎是一些容量问题。 以下 mods 使您的代码工作

    config <- spark_config()
    config$spark.yarn.keytab <- "<user.keytab>"
    config$spark.yarn.principal <- "<user@host>"
    config$spark.executor.cores <- 4
    config$spark.executor.memory <- "20g"
    config$spark.driver.memory <- "40g"
    config$spark.yarn.driver.memoryOverhead <- "8g"
    config$spark.yarn.executors.memoryOverhead <- "8g"
    config$spark.kryoserializer.buffer.max <- "256m"
    config$spark.dynamicAllocation.enabled <- "false"
    config$spark.executor.instances <- 24
    config$sparklyr.cores.local <- 4
    sc <- spark_connect(master = "yarn-client", version = "1.6.0", config = config) 
    
    
    iris_tbl <- copy_to(sc, iris)
    

    希望这会有所帮助.... 但是,如果我运行,我仍然遇到大型 Hive 表无法加载的问题

    dbGetQuery(sc, 'select * from large_table limit 10')
    

    【讨论】:

    • 运行本地集群时,所有这些设置都不是必需的。您的答案不是解决方法,因为他正在尝试使用 spark 2.0.1 并且您使用 1.6.0 加载它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-05-17
    • 2020-06-21
    • 2019-12-10
    • 2013-06-06
    • 1970-01-01
    • 2011-03-21
    • 2014-07-28
    相关资源
    最近更新 更多