如何在 Zeppelin 中检查 Spark 和 Scala 的版本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47199717/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 09:29:47  来源:igfitidea点击:

How to check version of Spark and Scala in Zeppelin?

scalaapache-sparkversionapache-zeppelin

提问by Haha TTpro

When I run interactive spark-shell, I show spark version (2.2.0) and scala version (2.11.8)

当我运行交互式 spark-shell 时,我显示 spark 版本(2.2.0)和 scala 版本(2.11.8)

Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /___/ .__/\_,_/_/ /_/\_\   version 2.2.0
      /_/

Using Scala version 2.11.8 (OpenJDK 64-Bit Server VM, Java 1.8.0_131)

However, I want to check which Spark and Scala version I am using with Zeppelin(localhost)

但是,我想检查我在 Zeppelin(localhost) 中使用的 Spark 和 Scala 版本

I am not sure that Zeppelin run same spark/scala with my interactive shell.

我不确定 Zeppelin 与我的交互式 shell 运行相同的 spark/scala。

(I checked https://community.hortonworks.com/questions/54918/how-do-i-tell-which-version-ofspark-i-am-running.html, but that is not I want because I host Zeppelin on localhost)

(我检查了https://community.hortonworks.com/questions/54918/how-do-i-tell-which-version-ofspark-i-am-running.html,但这不是我想要的,因为我在本地主机)

回答by Mehrez

for spark version you can run sc.versionand for scala run util.Properties.versionStringin your zeppelin note

对于 spark 版本,您可以在 zeppelin note 中运行sc.version和 scala runutil.Properties.versionString