简体   繁体   English

如何使用spark-shell导入自己的scala包?

[英]How to import own scala package using spark-shell?

I have written a class for spark-ml library that uses another classes from it. 我已经为spark-ml库编写了一个类,该类使用其中的另一个类。 If to be clear, my class is a wrapper for RandomForestClassifier. 如果清楚一点,我的课程是RandomForestClassifier的包装。 Now I want to have an opportunity to import this class from spark-shell. 现在,我想有机会从spark-shell导入此类。

So the question is: how to make package containing my own class that it will be able to be imported from spark-shell? 所以问题是:如何使包含我自己的类的包能够从spark-shell导入? Many thanks! 非常感谢!

如果要导入未编译的文件(例如Hello.scala ,请在spark shell中执行以下操作:

scala> :load ./src/main/scala/Hello.scala

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

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