Is there a way to rerun a pasted block of code in spark shell?

175 views Asked by At

I regularly copy blocks of code into spark-shell and run the block using

:paste ctrl-d

Sometimes it errors because another line of code is required first e.g. an import. Once I have added any other requirements in, I would like to rerun the whole pasted block. Is there a shortcut for doing this, rather than re-copying it, re-pasting? Something like reverse search but for whole blocks.

1

There are 1 answers

0
Dileep Dominic On

You can try to put together all the blocks in a file and run

scala> :load [path of file]