You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Nuthan Reddy <nu...@sigmoidanalytics.com> on 2019/03/05 11:14:21 UTC

How to add more imports at the start of REPL

Hi,

When launching the REPL using spark-submit, the following are loaded
automatically.

scala> :imports

 1) import org.apache.spark.SparkContext._ (70 terms, 1 are implicit)

 2) import spark.implicits._       (1 types, 67 terms, 37 are implicit)

 3) import spark.sql               (1 terms)

 4) import org.apache.spark.sql.functions._ (385 terms)
And i would like to add more imports which i frequently use to reduce the
typing that i do for these imports.
Can anyone suggest a way to do this?

Nuthan Reddy
Sigmoid Analytics

-- 
*Disclaimer*: This is not a mass e-mail and my intention here is purely 
from a business perspective, and not to spam or encroach your privacy. I am 
writing with a specific agenda to build a personal business connection. 
Being a reputed and genuine organization, Sigmoid respects the digital 
security of every prospect and tries to comply with GDPR and other regional 
laws. Please let us know if you feel otherwise and we will rectify the 
misunderstanding and adhere to comply in the future. In case we have missed 
any of the compliance, it is completely unintentional.

Re: How to add more imports at the start of REPL

Posted by Nuthan Reddy <nu...@sigmoidanalytics.com>.
Ok, thanks. It does solve the problem.

Nuthan Reddy
Sigmoid Analytics



On Tue, Mar 5, 2019 at 5:17 PM Jesús Vásquez <je...@gmail.com>
wrote:

> Hi Nuthan, I have had the same issue before.
> As a shortcut i created a text file called imports and then loaded it's
> content with the command :load of the scala repl
> Example:
> Create "imports" textfile with the import instructions you need
>
> import org.apache.hadoop.conf.Configuration
> import org.apache.hadoop.fs.Path
>
> Then load it with :load
>
> :load imports
>
> Once you have the textfile with the import instructions you just have to
> load it's content each time you start the repl.
> Regards.
>
>
> El mar., 5 de mar. de 2019 a la(s) 12:14, Nuthan Reddy (
> nuthan@sigmoidanalytics.com) escribió:
>
>> Hi,
>>
>> When launching the REPL using spark-submit, the following are loaded
>> automatically.
>>
>> scala> :imports
>>
>>  1) import org.apache.spark.SparkContext._ (70 terms, 1 are implicit)
>>
>>  2) import spark.implicits._       (1 types, 67 terms, 37 are implicit)
>>
>>  3) import spark.sql               (1 terms)
>>
>>  4) import org.apache.spark.sql.functions._ (385 terms)
>> And i would like to add more imports which i frequently use to reduce the
>> typing that i do for these imports.
>> Can anyone suggest a way to do this?
>>
>> Nuthan Reddy
>> Sigmoid Analytics
>>
>>
>> *Disclaimer*: This is not a mass e-mail and my intention here is purely
>> from a business perspective, and not to spam or encroach your privacy. I am
>> writing with a specific agenda to build a personal business connection.
>> Being a reputed and genuine organization, Sigmoid respects the digital
>> security of every prospect and tries to comply with GDPR and other regional
>> laws. Please let us know if you feel otherwise and we will rectify the
>> misunderstanding and adhere to comply in the future. In case we have missed
>> any of the compliance, it is completely unintentional.
>>
>

-- 
*Disclaimer*: This is not a mass e-mail and my intention here is purely 
from a business perspective, and not to spam or encroach your privacy. I am 
writing with a specific agenda to build a personal business connection. 
Being a reputed and genuine organization, Sigmoid respects the digital 
security of every prospect and tries to comply with GDPR and other regional 
laws. Please let us know if you feel otherwise and we will rectify the 
misunderstanding and adhere to comply in the future. In case we have missed 
any of the compliance, it is completely unintentional.

Re: How to add more imports at the start of REPL

Posted by Jesús Vásquez <je...@gmail.com>.
Hi Nuthan, I have had the same issue before.
As a shortcut i created a text file called imports and then loaded it's
content with the command :load of the scala repl
Example:
Create "imports" textfile with the import instructions you need

import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.Path

Then load it with :load

:load imports

Once you have the textfile with the import instructions you just have to
load it's content each time you start the repl.
Regards.


El mar., 5 de mar. de 2019 a la(s) 12:14, Nuthan Reddy (
nuthan@sigmoidanalytics.com) escribió:

> Hi,
>
> When launching the REPL using spark-submit, the following are loaded
> automatically.
>
> scala> :imports
>
>  1) import org.apache.spark.SparkContext._ (70 terms, 1 are implicit)
>
>  2) import spark.implicits._       (1 types, 67 terms, 37 are implicit)
>
>  3) import spark.sql               (1 terms)
>
>  4) import org.apache.spark.sql.functions._ (385 terms)
> And i would like to add more imports which i frequently use to reduce the
> typing that i do for these imports.
> Can anyone suggest a way to do this?
>
> Nuthan Reddy
> Sigmoid Analytics
>
>
> *Disclaimer*: This is not a mass e-mail and my intention here is purely
> from a business perspective, and not to spam or encroach your privacy. I am
> writing with a specific agenda to build a personal business connection.
> Being a reputed and genuine organization, Sigmoid respects the digital
> security of every prospect and tries to comply with GDPR and other regional
> laws. Please let us know if you feel otherwise and we will rectify the
> misunderstanding and adhere to comply in the future. In case we have missed
> any of the compliance, it is completely unintentional.
>