ciphor
ciphor

Reputation: 8288

Anyone tried to add R interpreter onto Apache Zeppelin?

I'm currently using Apache Zeppelin to do some data visualization stuff, just curious why there're no one providing an interpreter for R. From the documentation it seems that creating a new interpreter shouldn't be too hard, but if it is really that easy, there should already be the interpreters for various languages, so am I wrong?

Upvotes: 3

Views: 5384

Answers (3)

sag
sag

Reputation: 5461

EDIT

In new zeppelin, two R Interpreters are integrated into it. So we don't need below steps for latest versions.

Since 0.6.0 is not released we need to clone and built it

R Interpreter 1 (From Datalayer)

$git clone https://github.com/apache/incubator-zeppelin.git
$mvn clean package -Pspark-1.6 -Ppyspark -Phadoop-2.4 -Psparkr -DskipTests

R Interpreter 2

$git clone https://github.com/apache/incubator-zeppelin.git
$mvn clean package -Pspark-1.6 -Ppyspark -Phadoop-2.4 -Pr -DskipTests

More information about these R Interpreters can be found here

For zeppelin versions below 0.6.0 follow LaurentH steps

Try this R Interpreter from datalayer. We've tried it and able to do stuffs with it.

We were able to connect spark and do visualization using it. Said that, there are some few glitches like

  1. It does not have form support. Refer, https://github.com/datalayer/zeppelin-R/issues/1
  2. The default Spark Context can't be used. You have to create a Spark Context in R interpreter and use it

Steps to add R interpreter

  1. git clone https://github.com/datalayer/zeppelin-R.git
  2. Navigate to zeppelin-R and run mvn install
  3. Create R folder in incubator-zeppelin/interpreter
  4. Copy zeppelin-R/target/zeppelin-R-1.0.0-SNAPSHOT.jar to incubator-zeppelin/interpreter/R
  5. Download REngine jar from https://oss.sonatype.org/content/repositories/snapshots/org/rosuda/REngine/REngine/2.1.1-SNAPSHOT/ and add it in incubator-zeppelin/interpreter/R folder
  6. Download RServe jar from https://oss.sonatype.org/content/repositories/snapshots/org/rosuda/REngine/Rserve/1.8.2-SNAPSHOT/ and add it in incubator-zeppelin/interpreter/R folder
  7. Copy incubator-zeppelin/conf/zeppelin-env.sh.template to incubator-zeppelin/conf/zeppelin-site.xml
  8. Edit incubator-zeppelin/conf/zeppelin-site.xml and add “io.datalayer.zeppelin.R.RInterpreter” to zeppelin.interpreters
  9. Restart zeppelin
  10. Open Zeppelin UI and click Interpreter
  11. Click “Create” button and add R interpreter
  12. Now you can use R interpreter in notebook

Hope it helps

Upvotes: 3

LaurentH
LaurentH

Reputation: 21

Tried Samuel Alexander's procedure, but didn't manage to get zeppelin-R-1.0.0-SNAPSHOT.jar. Changing the steps a bit, I got R integrated like this :

  1. setup prerequisites as stated in https://github.com/datalayer/zeppelin-datalayer : R, R packages, Spark in /opt/spark (or specify your existing spark location using export SPARK_HOME)
  2. git clone https://github.com/datalayer/zeppelin-R.git
  3. cd zeppelin-R
  4. git checkout rscala-z
  5. mvn clean install -Pspark-1.6 -Dspark.version=1.6.0 \ -Dhadoop.version=2.7.1 -Phadoop-2.6 -Ppyspark \ -Dmaven.findbugs.enable=false -Drat.skip=true -Dcheckstyle.skip=true \ -DskipTests \ -pl '!flink,!ignite,!phoenix,!postgresql,!tajo,!hive,!cassandra,!lens,!kylin'
  6. copy zeppelin-R/interpreter/spark/* to your original incubator-zeppelin/interpreter/spark/* (including zeppelin-spark-0.6.0-incubating-SNAPSHOT which contains SparkRInterpreter)
  7. copy incubator-zeppelin/conf/zeppelin-site.xml.template to incubator-zeppelin/conf/zeppelin-site.xml
  8. edit incubator-zeppelin/conf/zeppelin-site.xml and add “org.apache.zeppelin.spark.SparkRInterpreter” to zeppelin.interpreters (this will add %r in the spark interpreter group)
  9. restart zeppelin

Hope it can help.

Upvotes: 2

Bo Werth
Bo Werth

Reputation: 1

I am trying to use the zeppelin-R interpreter with incubator-zeppelin - could you describe how this interpreter can be recognized by Zeppelin?

I manage to compile and run incubator-zeppelin and could compile zeppelin-R. Afterwards, I copied the zeppelin-R directory into the incubator-zeppelin root directory and add <module>zeppelin-R</module> to the pom.xml in the root directory. I can recompile incubator-zeppelin without problems but the R interpreter does not show up in Zeppelin.

Upvotes: 0

Related Questions