简体   繁体   English

在Spark中使用Scala脚本

[英]Using Scala script in Spark

We are planning to using Scala on Spark to make computations. 我们计划在Spark上使用Scala进行计算。 Just want to know what is the best way to execute Scala in Spark ; 只想知道在Spark执行Scala的最佳方法是什么? Scala as Script (or) Scala as Application . Scala as Script (或Scala as Application Is there any advantage / disadvantage between these 2 methods? 这两种方法之间有什么优点 / 缺点

As mentioned here it is possible to execute Scala as Script . 如前所述这里就可以执行Scala as Script I am trying to skip the compilation process using sbt so that I can use Scala as script just like we will use Python 我试图跳过使用sbt的编译过程,以便可以像使用Python一样将Scala用作脚本

I suppose you mean by scala as script the scala REPL comes with spark (spark-shell) and scala application is the standlaone appliction packaged by sbt or maven . 我想您所说的scala是脚本,scala REPL带有spark(spark-shell),而scala应用程序是sbtmaven打包的标准应用程序。

  • Use scala shell ( spark-shell ) to test your algoriothm/implementation . 使用scala shell( spark-shell )测试您的算法/实现。 So it should be used as staging phase. 因此,应将其用作登台阶段。
  • When you have tested your implementation you should put it in a standalone application, package it and deliever a "fat jar" that could be submited by using spark-submit 测试完实现后,应将其放入独立的应用程序中,打包并释放“胖罐”,该罐可以通过使用spark-submit

Hope this is clear enough 希望这足够清楚

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM