-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Run sequence is not preserved #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
|
I think I ran into NFLabs/zeppelin#395 just now |
Member
Author
|
I'm merging it if there's no discussion. |
asfgit
pushed a commit
that referenced
this pull request
Apr 5, 2016
### What is this PR for? Implement R and SpakR Intepreter as part of the Spark Interpreter Group. It also implements R and Scala binding (in both directions). ### What type of PR is it? [Feature] ### Todos * [ ] - Documentation * [ ] - Unit test (if relevant, as we depend on R being available on the host) * [ ] - Assess licensing (a priori ok as we don't delive anything out of ASL2, but we should corectly phrase the NOTICE as we depend on non-ASL2 comptabile licenses (R) to run the interpreter). ### Is there a relevant Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-156 SparkR support ### How should this be tested? You need R available on the host running the notebook. For Centos: yum install R R-devel For Ubuntu: apt-get install r-base r-cran-rserve Install additional R packages: ``` curl https://cran.r-project.org/src/contrib/Archive/rscala/rscala_1.0.6.tar.gz -o /tmp/rscala_1.0.6.tar.gz R CMD INSTALL /tmp/rscala_1.0.6.tar.gz R -e "install.packages('ggplot2', repos = 'http://cran.us.r-project.org')" R -e install.packages('knitr', repos = 'http://cran.us.r-project.org') ``` - Build + launch Zeppelin and test the R note. !!! you need rscala_1.0.6 (if not, you need to build with -Drscala.version=...) ### Screenshots (if appropriate) #### Simple R [](https://raw.githubusercontent.com/datalayer/zeppelin-R/rscala/_Rimg/simple-r.png) #### Plot [](https://raw.githubusercontent.com/datalayer/zeppelin-R/rscala/_Rimg/plot.png) #### Scala R Binding [](https://raw.githubusercontent.com/datalayer/zeppelin-R/rscala/_Rimg/scala-r.png) #### R Scala Binding [](https://raw.githubusercontent.com/datalayer/zeppelin-R/rscala/_Rimg/r-scala.png) #### SparkR [](https://raw.githubusercontent.com/datalayer/zeppelin-R/rscala/_Rimg/sparkr.png) ### Questions: * Does the licenses files need update? to be checked... (cfr R needs to be available to make this interpreter operational). * Is there breaking changes for older versions? No * Does this needs documentation? Yes Author: Eric Charles <[email protected]> Author: Lee moon soo <[email protected]> This patch had conflicts when merged, resolved by Committer: Lee moon soo <[email protected]> Closes #702 from echarles/rscala-z and squashes the following commits: 137040c [Eric Charles] Trigger build again 53645f6 [Eric Charles] Trigger build 519f3a9 [Eric Charles] Add back the spark.bin.download.url property for sparkr profile d1f0521 [Eric Charles] Merge with master 72ab72c [Eric Charles] Trigger travis build 151af0a [Eric Charles] Enable back the R install in travis ed70820 [Eric Charles] Merge with master ae21036 [Eric Charles] Note: unlist array passed from scala to R, patch contributed by @jeffsteinmetz ac0e16d [Eric Charles] Merge pull request #8 from Leemoonsoo/rscala-z-fix-interpreter-list-order 90c1b4d [Lee moon soo] Sort interpreter list correctly c36fe8a [Eric Charles] Return SUCCESS if result is empty 463c066 [Eric Charles] Log exception on open f6e685a [Eric Charles] Remove SparkRInterpeterTest, test is convered in ZeppelinSparkClusterTest 19ec4f3 [Eric Charles] Add back SparkRInterpreterTest.java 58227e9 [Eric Charles] Merge branch 'rscala-z-rs' into rscala-z 290289f [Eric Charles] Merge with master eb6c40c [Eric Charles] Merge remote rscala-z-rs 962d0d9 [Eric Charles] DOC: Add more visualization libraries 9b95d60 [Lee moon soo] Remove unnecessary test 894c399 [Lee moon soo] Remove SparkRInterpreterTest bac1e1b [Lee moon soo] R on travis f6661c2 [Lee moon soo] fix profile activation 1a0195f [Lee moon soo] exclude test when sparkr profile is not defined 2307115 [Lee moon soo] Make sparkr work without SPARK_HOME dcfee32 [Lee moon soo] Add test aa35a83 [Lee moon soo] Download sparkR package 1d99fa8 [Lee moon soo] Remove rscala related stuff from project fc66da9 [Lee moon soo] R -> r a122894 [Lee moon soo] render output 9df9535 [Lee moon soo] Remove rscala dependency 1e2c99b [Eric Charles] DOC: no need for r-cran-rserve, thx to @jeffsteinmetz 2300ebc [Eric Charles] Update to latest change in interpeter constructs ecf8bc4 [Eric Charles] Merge with master a119b72 [Eric Charles] Merge with remote 454c1cb [Eric Charles] Rebase on master and update test to deal with interpretercontext constructor change b30f6f4 [Eric Charles] Support HTML, TABLE and IMG display - Dynamic form in progress 89d6a3a [Eric Charles] DOC: Fix typo (contributed by @AhyoungRyu) + fix missing depencies (contributed by @btiernay on https://github.com/datalayer/datalayer-zeppelin/issues/6) a6a3695 [Eric Charles] fix SparkInterpreterTest to deal with previous commit chanching the returned html 35486c7 [Eric Charles] Always return html preview in case of pure text a0306fc [Eric Charles] Fix the expected html value for test 47eec88 [Eric Charles] Fix code format to make checkstyle happy f963e1c [Eric Charles] polish examples with title 6cf8615 [Eric Charles] Make it work also on chromium 7b04b6b [Eric Charles] Support ggplot2 output size https://github.com/datalayer/zeppelin-R/issues/2 17d6b0d [Eric Charles] Less test in the SparkRInterpreterTest f4aac04 [Eric Charles] Add interactive visualization example 816f4d9 [Eric Charles] Run only one test method and see Travis reaction 702556f [Eric Charles] RAT: Disabel RAT check on downloaded rscala folder d5538a2 [Eric Charles] update pom to download rscala on build 40efe33 [Eric Charles] Add test for SparkRInterpreter 09bb458 [Eric Charles] Use java factory to allow mockito usage 5385adb [Eric Charles] Add jar in R folder c0063fc [Eric Charles] Ignore downloaded rscala 4d5cfa5 [Eric Charles] Initial documentation for R Interpreter 3e24d02 [Eric Charles] Add license for rscala c88a914 [Eric Charles] Remove rscala jar 554bcb6 [Eric Charles] Add README.md placeholder for rscala lib folder 40b4ec6 [Eric Charles] Remove png files and restore README.md 220fe51 [Eric Charles] Make rscala configurable in the spark-dependencies module 15375eb [Eric Charles] Add SparRInterpreter implementation 4161619 [Eric Charles] Support HTML, TABLE and IMG display - Dynamic form in progress 8e635e1 [Eric Charles] DOC: Fix typo (contributed by @AhyoungRyu) + fix missing depencies (contributed by @btiernay on https://github.com/datalayer/datalayer-zeppelin/issues/6) 9a988f9 [Eric Charles] fix SparkInterpreterTest to deal with previous commit chanching the returned html 28fc9b2 [Eric Charles] Always return html preview in case of pure text e8ed8dd [Eric Charles] Fix the expected html value for test facc682 [Eric Charles] Fix code format to make checkstyle happy 9b168ff [Eric Charles] polish examples with title 8b059c4 [Eric Charles] Make it work also on chromium 66c3545 [Eric Charles] Support ggplot2 output size https://github.com/datalayer/zeppelin-R/issues/2 3ae0bc1 [Eric Charles] Less test in the SparkRInterpreterTest b9b2787 [Eric Charles] Add interactive visualization example 9218d65 [Eric Charles] Run only one test method and see Travis reaction ee6e43b [Eric Charles] RAT: Disabel RAT check on downloaded rscala folder 8d664f6 [Eric Charles] update pom to download rscala on build 21668b3 [Eric Charles] Add test for SparkRInterpreter 068ac24 [Eric Charles] Use java factory to allow mockito usage caf157b [Eric Charles] Add jar in R folder 1eddadb [Eric Charles] Ignore downloaded rscala 0af2bec [Eric Charles] Initial documentation for R Interpreter 8e3c997 [Eric Charles] Add license for rscala 7a95ef4 [Eric Charles] Remove rscala jar b8ae4eb [Eric Charles] Add README.md placeholder for rscala lib folder aa6a7a1 [Eric Charles] Remove png files and restore README.md 9312a0c [Eric Charles] Make rscala configurable in the spark-dependencies module 363b244 [Eric Charles] Add SparRInterpreter implementation
onkarshedge
pushed a commit
to onkarshedge/incubator-zeppelin
that referenced
this pull request
May 11, 2016
### What is this PR for? Implement R and SpakR Intepreter as part of the Spark Interpreter Group. It also implements R and Scala binding (in both directions). ### What type of PR is it? [Feature] ### Todos * [ ] - Documentation * [ ] - Unit test (if relevant, as we depend on R being available on the host) * [ ] - Assess licensing (a priori ok as we don't delive anything out of ASL2, but we should corectly phrase the NOTICE as we depend on non-ASL2 comptabile licenses (R) to run the interpreter). ### Is there a relevant Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-156 SparkR support ### How should this be tested? You need R available on the host running the notebook. For Centos: yum install R R-devel For Ubuntu: apt-get install r-base r-cran-rserve Install additional R packages: ``` curl https://cran.r-project.org/src/contrib/Archive/rscala/rscala_1.0.6.tar.gz -o /tmp/rscala_1.0.6.tar.gz R CMD INSTALL /tmp/rscala_1.0.6.tar.gz R -e "install.packages('ggplot2', repos = 'http://cran.us.r-project.org')" R -e install.packages('knitr', repos = 'http://cran.us.r-project.org') ``` - Build + launch Zeppelin and test the R note. !!! you need rscala_1.0.6 (if not, you need to build with -Drscala.version=...) ### Screenshots (if appropriate) #### Simple R [](https://raw.githubusercontent.com/datalayer/zeppelin-R/rscala/_Rimg/simple-r.png) #### Plot [](https://raw.githubusercontent.com/datalayer/zeppelin-R/rscala/_Rimg/plot.png) #### Scala R Binding [](https://raw.githubusercontent.com/datalayer/zeppelin-R/rscala/_Rimg/scala-r.png) #### R Scala Binding [](https://raw.githubusercontent.com/datalayer/zeppelin-R/rscala/_Rimg/r-scala.png) #### SparkR [](https://raw.githubusercontent.com/datalayer/zeppelin-R/rscala/_Rimg/sparkr.png) ### Questions: * Does the licenses files need update? to be checked... (cfr R needs to be available to make this interpreter operational). * Is there breaking changes for older versions? No * Does this needs documentation? Yes Author: Eric Charles <[email protected]> Author: Lee moon soo <[email protected]> This patch had conflicts when merged, resolved by Committer: Lee moon soo <[email protected]> Closes apache#702 from echarles/rscala-z and squashes the following commits: 137040c [Eric Charles] Trigger build again 53645f6 [Eric Charles] Trigger build 519f3a9 [Eric Charles] Add back the spark.bin.download.url property for sparkr profile d1f0521 [Eric Charles] Merge with master 72ab72c [Eric Charles] Trigger travis build 151af0a [Eric Charles] Enable back the R install in travis ed70820 [Eric Charles] Merge with master ae21036 [Eric Charles] Note: unlist array passed from scala to R, patch contributed by @jeffsteinmetz ac0e16d [Eric Charles] Merge pull request apache#8 from Leemoonsoo/rscala-z-fix-interpreter-list-order 90c1b4d [Lee moon soo] Sort interpreter list correctly c36fe8a [Eric Charles] Return SUCCESS if result is empty 463c066 [Eric Charles] Log exception on open f6e685a [Eric Charles] Remove SparkRInterpeterTest, test is convered in ZeppelinSparkClusterTest 19ec4f3 [Eric Charles] Add back SparkRInterpreterTest.java 58227e9 [Eric Charles] Merge branch 'rscala-z-rs' into rscala-z 290289f [Eric Charles] Merge with master eb6c40c [Eric Charles] Merge remote rscala-z-rs 962d0d9 [Eric Charles] DOC: Add more visualization libraries 9b95d60 [Lee moon soo] Remove unnecessary test 894c399 [Lee moon soo] Remove SparkRInterpreterTest bac1e1b [Lee moon soo] R on travis f6661c2 [Lee moon soo] fix profile activation 1a0195f [Lee moon soo] exclude test when sparkr profile is not defined 2307115 [Lee moon soo] Make sparkr work without SPARK_HOME dcfee32 [Lee moon soo] Add test aa35a83 [Lee moon soo] Download sparkR package 1d99fa8 [Lee moon soo] Remove rscala related stuff from project fc66da9 [Lee moon soo] R -> r a122894 [Lee moon soo] render output 9df9535 [Lee moon soo] Remove rscala dependency 1e2c99b [Eric Charles] DOC: no need for r-cran-rserve, thx to @jeffsteinmetz 2300ebc [Eric Charles] Update to latest change in interpeter constructs ecf8bc4 [Eric Charles] Merge with master a119b72 [Eric Charles] Merge with remote 454c1cb [Eric Charles] Rebase on master and update test to deal with interpretercontext constructor change b30f6f4 [Eric Charles] Support HTML, TABLE and IMG display - Dynamic form in progress 89d6a3a [Eric Charles] DOC: Fix typo (contributed by @AhyoungRyu) + fix missing depencies (contributed by @btiernay on https://github.com/datalayer/datalayer-zeppelin/issues/6) a6a3695 [Eric Charles] fix SparkInterpreterTest to deal with previous commit chanching the returned html 35486c7 [Eric Charles] Always return html preview in case of pure text a0306fc [Eric Charles] Fix the expected html value for test 47eec88 [Eric Charles] Fix code format to make checkstyle happy f963e1c [Eric Charles] polish examples with title 6cf8615 [Eric Charles] Make it work also on chromium 7b04b6b [Eric Charles] Support ggplot2 output size https://github.com/datalayer/zeppelin-R/issues/2 17d6b0d [Eric Charles] Less test in the SparkRInterpreterTest f4aac04 [Eric Charles] Add interactive visualization example 816f4d9 [Eric Charles] Run only one test method and see Travis reaction 702556f [Eric Charles] RAT: Disabel RAT check on downloaded rscala folder d5538a2 [Eric Charles] update pom to download rscala on build 40efe33 [Eric Charles] Add test for SparkRInterpreter 09bb458 [Eric Charles] Use java factory to allow mockito usage 5385adb [Eric Charles] Add jar in R folder c0063fc [Eric Charles] Ignore downloaded rscala 4d5cfa5 [Eric Charles] Initial documentation for R Interpreter 3e24d02 [Eric Charles] Add license for rscala c88a914 [Eric Charles] Remove rscala jar 554bcb6 [Eric Charles] Add README.md placeholder for rscala lib folder 40b4ec6 [Eric Charles] Remove png files and restore README.md 220fe51 [Eric Charles] Make rscala configurable in the spark-dependencies module 15375eb [Eric Charles] Add SparRInterpreter implementation 4161619 [Eric Charles] Support HTML, TABLE and IMG display - Dynamic form in progress 8e635e1 [Eric Charles] DOC: Fix typo (contributed by @AhyoungRyu) + fix missing depencies (contributed by @btiernay on https://github.com/datalayer/datalayer-zeppelin/issues/6) 9a988f9 [Eric Charles] fix SparkInterpreterTest to deal with previous commit chanching the returned html 28fc9b2 [Eric Charles] Always return html preview in case of pure text e8ed8dd [Eric Charles] Fix the expected html value for test facc682 [Eric Charles] Fix code format to make checkstyle happy 9b168ff [Eric Charles] polish examples with title 8b059c4 [Eric Charles] Make it work also on chromium 66c3545 [Eric Charles] Support ggplot2 output size https://github.com/datalayer/zeppelin-R/issues/2 3ae0bc1 [Eric Charles] Less test in the SparkRInterpreterTest b9b2787 [Eric Charles] Add interactive visualization example 9218d65 [Eric Charles] Run only one test method and see Travis reaction ee6e43b [Eric Charles] RAT: Disabel RAT check on downloaded rscala folder 8d664f6 [Eric Charles] update pom to download rscala on build 21668b3 [Eric Charles] Add test for SparkRInterpreter 068ac24 [Eric Charles] Use java factory to allow mockito usage caf157b [Eric Charles] Add jar in R folder 1eddadb [Eric Charles] Ignore downloaded rscala 0af2bec [Eric Charles] Initial documentation for R Interpreter 8e3c997 [Eric Charles] Add license for rscala 7a95ef4 [Eric Charles] Remove rscala jar b8ae4eb [Eric Charles] Add README.md placeholder for rscala lib folder aa6a7a1 [Eric Charles] Remove png files and restore README.md 9312a0c [Eric Charles] Make rscala configurable in the spark-dependencies module 363b244 [Eric Charles] Add SparRInterpreter implementation
asfgit
pushed a commit
that referenced
this pull request
Sep 27, 2016
## What is this PR for? The PR is a interpreter for [Apache Beam](http://beam.incubator.apache.org) which is an open source unified platform for data processing pipelines. A pipeline can be build using one of the Beam SDKs. The execution of the pipeline is done by different Runners . Currently, Beam supports Apache Flink Runner, Apache Spark Runner, and Google Dataflow Runner. ### What type of PR is it? - Feature ### Todos * Test case * Review Comments * Documentation ### What is the Jira issue? * [ZEPPELIN-682] ### How should this be tested? - Start the Zeppelin server - The prefix of interpreter is `%beam` and then write your code with required imports and the runner ### Screenshots (if appropriate)   ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? yes Author: mahmoudelgamal <[email protected]> Author: mfelgamal <[email protected]> Author: Fouad <[email protected]> Closes #1334 from mfelgamal/beam-interpreter-static-repl-7 and squashes the following commits: da66c27 [mahmoudelgamal] Modify condition of checking static modifier 55c1322 [mahmoudelgamal] set spark version to 1.6.2 and throw original exception 27d7690 [mahmoudelgamal] set spark version to 1.6.1 and some modifications 750041c [mahmoudelgamal] Add readme file and modify pom file and travis.yml ca88f94 [mahmoudelgamal] edit pom file and .travis.yml 3d65427 [mahmoudelgamal] update .travis.yml file f19f98d [mahmoudelgamal] Make easy example with imports ands some modifications 74c14ca [mahmoudelgamal] Update the licenses acc7afb [mahmoudelgamal] Change beam to version 0.2.0 e821614 [mahmoudelgamal] Removing hadoop-core and print stack trace to failure 5cb7c7b [mahmoudelgamal] Add some changes to doc and pom file 75fc4f7 [mahmoudelgamal] add interpreter to navigation.html and remove extra spaces and lines 9b1b385 [mahmoudelgamal] put beam in alphabetical order 9c1e25d [mahmoudelgamal] Adding changes like logging and conventions and license 2aa6d65 [mahmoudelgamal] changing class name to StaticRepl and adding some modifications 7cf25fb [mahmoudelgamal] Adding some tests 3c5038f [mahmoudelgamal] Modifying the documentation 5695077 [mahmoudelgamal] Modifying pom file and Making documentation 26fc59b [mahmoudelgamal] Refactoring of the code 3a2bd85 [mahmoudelgamal] Adding the beam to zeppelin 7 ab7ee2d [mahmoudelgamal] beam interpreter 85957ff [mfelgamal] Merge pull request #10 from apache/master 852c3d3 [mfelgamal] Merge pull request #9 from apache/master a4bcc0d [mfelgamal] Merge pull request #8 from apache/master 858f1e1 [mfelgamal] Merge pull request #7 from apache/master 03a1e80 [mfelgamal] Merge pull request #4 from apache/master 2586651 [Fouad] Merge pull request #2 from apache/master
pedrozatta
pushed a commit
to pedrozatta/zeppelin
that referenced
this pull request
Oct 27, 2016
## What is this PR for? The PR is a interpreter for [Apache Beam](http://beam.incubator.apache.org) which is an open source unified platform for data processing pipelines. A pipeline can be build using one of the Beam SDKs. The execution of the pipeline is done by different Runners . Currently, Beam supports Apache Flink Runner, Apache Spark Runner, and Google Dataflow Runner. ### What type of PR is it? - Feature ### Todos * Test case * Review Comments * Documentation ### What is the Jira issue? * [ZEPPELIN-682] ### How should this be tested? - Start the Zeppelin server - The prefix of interpreter is `%beam` and then write your code with required imports and the runner ### Screenshots (if appropriate)   ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? yes Author: mahmoudelgamal <[email protected]> Author: mfelgamal <[email protected]> Author: Fouad <[email protected]> Closes apache#1334 from mfelgamal/beam-interpreter-static-repl-7 and squashes the following commits: da66c27 [mahmoudelgamal] Modify condition of checking static modifier 55c1322 [mahmoudelgamal] set spark version to 1.6.2 and throw original exception 27d7690 [mahmoudelgamal] set spark version to 1.6.1 and some modifications 750041c [mahmoudelgamal] Add readme file and modify pom file and travis.yml ca88f94 [mahmoudelgamal] edit pom file and .travis.yml 3d65427 [mahmoudelgamal] update .travis.yml file f19f98d [mahmoudelgamal] Make easy example with imports ands some modifications 74c14ca [mahmoudelgamal] Update the licenses acc7afb [mahmoudelgamal] Change beam to version 0.2.0 e821614 [mahmoudelgamal] Removing hadoop-core and print stack trace to failure 5cb7c7b [mahmoudelgamal] Add some changes to doc and pom file 75fc4f7 [mahmoudelgamal] add interpreter to navigation.html and remove extra spaces and lines 9b1b385 [mahmoudelgamal] put beam in alphabetical order 9c1e25d [mahmoudelgamal] Adding changes like logging and conventions and license 2aa6d65 [mahmoudelgamal] changing class name to StaticRepl and adding some modifications 7cf25fb [mahmoudelgamal] Adding some tests 3c5038f [mahmoudelgamal] Modifying the documentation 5695077 [mahmoudelgamal] Modifying pom file and Making documentation 26fc59b [mahmoudelgamal] Refactoring of the code 3a2bd85 [mahmoudelgamal] Adding the beam to zeppelin 7 ab7ee2d [mahmoudelgamal] beam interpreter 85957ff [mfelgamal] Merge pull request apache#10 from apache/master 852c3d3 [mfelgamal] Merge pull request apache#9 from apache/master a4bcc0d [mfelgamal] Merge pull request apache#8 from apache/master 858f1e1 [mfelgamal] Merge pull request apache#7 from apache/master 03a1e80 [mfelgamal] Merge pull request apache#4 from apache/master 2586651 [Fouad] Merge pull request apache#2 from apache/master
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR came from ZEPL/zeppelin#397
After ZEPL/zeppelin#364, order of submitted job to the remote interpreter is not preserved.
Result is, when user run a lot of paragraphs in a short time, they run in random order(like click run 'Run all paragraphs). https://github.com/NFLabs/zeppelin/issues/395 is one of the possible problem.
this PR adds some unittests and fix the problem.
Ready to merge.