Skip to content

Conversation

@Leemoonsoo
Copy link
Member

What is this PR for?

This PR fixes R interpreter doesn't work with Spark 2.0

What type of PR is it?

Bug Fix

Todos

  • - Create and inject SparkSession into SparkRInterpreter

What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-1260

How should this be tested?

Run Zeppelin with Spark 2.0 and run following codes and see if it returns [1] 3

%r 
localDF <- data.frame(name=c("a", "b", "c"), age=c(19, 23, 18))
df <- createDataFrame(spark, localDF)
count(df)

Screenshots (if appropriate)

image

Questions:

  • Does the licenses files need update? no
  • Is there breaking changes for older versions? no
  • Does this needs documentation? no

*/
public ZeppelinR(String rCmdPath, String libPath, int sparkRBackendPort) {
public ZeppelinR(String rCmdPath, String libPath,
int sparkRBackendPort, SparkVersion sparkVersion) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nitpick (so no need to change if you do not feel like it) but Is that IDE formatting?
As horizontal alignment is usually discouraged.

@bzz
Copy link
Member

bzz commented Aug 2, 2016

Looks great to me, modulo question above.

Thank you for prompt fix @Leemoonsoo !
Shall we merge it only to master or branch-0.6 as well? Asking as JIRA fix version is not set for this one.

@Leemoonsoo
Copy link
Member Author

@bzz Thanks for quick review. Updated the indent.
This should be merged to branch-0.6 as well

@echarles
Copy link
Member

echarles commented Aug 2, 2016

@minahlee Just saw you comment on ZEPPELIN-1260, but @Leemoonsoo has been fast...

I have tested the changes, and now sparkr dataframes are working well (with the spark variable which referts to the new Spark2 session).

The R tutorial note refers to sqlContext which is no more present

Error in dispatchFunc("createDataFrame(data, schema = NULL, samplingRatio = 1.0)", : object 'sqlContext' not found

Patch could also expose sqlContext.

@Leemoonsoo
Copy link
Member Author

Thanks @echarles for the review. I have exposed sqlContext as well

@echarles
Copy link
Member

echarles commented Aug 2, 2016

LGTM

@Leemoonsoo
Copy link
Member Author

Merge it into master and branch-0.6 if there're no more discussion

@asfgit asfgit closed this in 52b3cbf Aug 3, 2016
asfgit pushed a commit that referenced this pull request Aug 3, 2016
### What is this PR for?
This PR fixes R interpreter doesn't work with Spark 2.0

### What type of PR is it?
Bug Fix

### Todos
* [x] - Create and inject SparkSession into SparkRInterpreter

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1260

### How should this be tested?
Run Zeppelin with Spark 2.0 and run following codes and see if it returns `[1] 3`
```
%r
localDF <- data.frame(name=c("a", "b", "c"), age=c(19, 23, 18))
df <- createDataFrame(spark, localDF)
count(df)
```

### Screenshots (if appropriate)
![image](https://cloud.githubusercontent.com/assets/1540981/17324196/fbf3df6c-586a-11e6-896f-68fd86e630e8.png)

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: Lee moon soo <[email protected]>

Closes #1259 from Leemoonsoo/ZEPPELIN-1260 and squashes the following commits:

b3df11f [Lee moon soo] inject sqlContext as well
02822ac [Lee moon soo] Change indent
6bd1128 [Lee moon soo] Create and inject spark session into sparkr interpreter

(cherry picked from commit 52b3cbf)
Signed-off-by: Mina Lee <[email protected]>
PhilippGrulich pushed a commit to SWC-SENSE/zeppelin that referenced this pull request Aug 8, 2016
### What is this PR for?
This PR fixes R interpreter doesn't work with Spark 2.0

### What type of PR is it?
Bug Fix

### Todos
* [x] - Create and inject SparkSession into SparkRInterpreter

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1260

### How should this be tested?
Run Zeppelin with Spark 2.0 and run following codes and see if it returns `[1] 3`
```
%r
localDF <- data.frame(name=c("a", "b", "c"), age=c(19, 23, 18))
df <- createDataFrame(spark, localDF)
count(df)
```

### Screenshots (if appropriate)
![image](https://cloud.githubusercontent.com/assets/1540981/17324196/fbf3df6c-586a-11e6-896f-68fd86e630e8.png)

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: Lee moon soo <[email protected]>

Closes apache#1259 from Leemoonsoo/ZEPPELIN-1260 and squashes the following commits:

b3df11f [Lee moon soo] inject sqlContext as well
02822ac [Lee moon soo] Change indent
6bd1128 [Lee moon soo] Create and inject spark session into sparkr interpreter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants