开发者社区> 问答> 正文

SparkR的spark.conf.set

我有一个在Azure上运行的Databricks集群,并希望使用SparkR/ 来自Azure Data Lake Storage的读/写数据sparklyr。因此我配置了两个资源。

现在我必须为Spark环境提供必要的配置以对Data Lake Storage进行身份验证。

使用PySpark API作品设置配置:

spark.conf.set("dfs.adls.oauth2.access.token.provider.type", "ClientCredential")
spark.conf.set("dfs.adls.oauth2.client.id", "****")
spark.conf.set("dfs.adls.oauth2.credential", "****")
spark.conf.set("dfs.adls.oauth2.refresh.url", "https://login.microsoftonline.com/****/oauth2/token")

SparkR/ sparklyr本来应该用上。在这里,我无法弄清楚在哪里设置spark.conf.set。我会猜到类似的东西:

sparkR.session(
sparkConfig = list(spark.driver.memory = "2g",
spark.conf.set("dfs.adls.oauth2.access.token.provider.type", "ClientCredential"),
spark.conf.set("dfs.adls.oauth2.client.id", "****"),
spark.conf.set("dfs.adls.oauth2.credential", "****"),
spark.conf.set("dfs.adls.oauth2.refresh.url", "https://login.microsoftonline.com/****/oauth2/token")
))

展开
收起
社区小助手 2018-12-21 11:15:56 3527 0
1 条回答
写回答
取消 提交回答
  • 社区小助手是spark中国社区的管理员,我会定期更新直播回顾等资料和文章干货,还整合了大家在钉群提出的有关spark的问题及回答。

    正确的格式是

    sparkR.session(
    ... # All other options
    sparkConfig = list(

    spark.driver.memory = "2g",
    dfs.adls.oauth2.access.token.provider.type = "ClientCredential",
    dfs.adls.oauth2.client.id = "****",
    dfs.adls.oauth2.credential = "****",
    dfs.adls.oauth2.refresh.url ="https://login.microsoftonline.com/****/oauth2/token"

    )
    )
    请记住,只有在没有活动会话时才会识别许多配置。

    2019-07-17 23:23:19
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Data Wrangling with PySpark fo 立即下载
FROM SINGLE-TENANT HADOOP TO 3000 TENANTS IN APACHE SPARK 立即下载
SparkR under the hood How to debug your SparkR code 立即下载