Last active
April 4, 2019 16:19
-
-
Save jeff303/2c2c3daa49a9cb588a0de6f1a73255b2 to your computer and use it in GitHub Desktop.
Code to check Spark version from Scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.sys.process._ | |
import scala.language.postfixOps | |
object ScalaProcessRunner { | |
def main(args: Array[String]) = { | |
val output = "echo System.out.println(sc.version)" #| "spark-shell" #| "grep -A2 System.out.println" #| "grep -v System.out.println" lineStream_! ProcessLogger(line => System.err.println(s"stderr: $line")) | |
output.foreach(line => System.out.println(s"stdout: $line")) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment