Skip to content

Conversation

@zjffdu
Copy link
Contributor

@zjffdu zjffdu commented Sep 20, 2016

What is this PR for?

ZeppelinContext.show doesn't work for spark 1.6. The root cause is that Dataset is also available in spark 1.6, so the following line will be false when cls is Dataset while o is Dataframe in spark 1.6

if (cls.isInstance(o)) {

This PR create a list of supported class and make it a member of ZeppelinContextso that we don't need to create it every time.

What type of PR is it?

[Bug Fix]

Todos

  • - Task

What is the Jira issue?

How should this be tested?

Tested it manually on spark 1.6 using the following sample code

z.show(sqlContext.sql("show tables"))

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

@zjffdu
Copy link
Contributor Author

zjffdu commented Sep 20, 2016

@Leemoonsoo Please help review, I will add system test after #1404 is merged

@Leemoonsoo
Copy link
Member

Leemoonsoo commented Sep 21, 2016

Tested and it works well! Let me know when you add test!

@zjffdu
Copy link
Contributor Author

zjffdu commented Sep 22, 2016

@Leemoonsoo I added some unit test, and also fix another bug. The bug is that exception will be throw when display Dataset, because we assume the type of each Record is Row while it is not true for Dataset, so I convert Dataset to DataFrame first when displaying Dataset.

The failed test is irrelevant.

@Leemoonsoo
Copy link
Member

Thanks for the fix.
LGTM and merge to master and branch-0.6 if there're no more discussions.

asfgit pushed a commit that referenced this pull request Sep 26, 2016
### What is this PR for?
`ZeppelinContext.show` doesn't work for spark 1.6. The root cause is that `Dataset` is also available in spark 1.6, so the following line will be false when cls is `Dataset` while o is `Dataframe` in spark 1.6
```
if (cls.isInstance(o)) {
```
This PR create a list of supported class and make it a member of `ZeppelinContext `so that we don't need to create it every time.

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

### Todos
* [ ] - Task

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

### How should this be tested?
Tested it manually on spark 1.6 using the following sample code
```
z.show(sqlContext.sql("show tables"))
```

### Screenshots (if appropriate)
![image](https://cloud.githubusercontent.com/assets/164491/18657995/cb25d8e8-7f31-11e6-8b26-62f39bc5587e.png)

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

Author: Jeff Zhang <[email protected]>

Closes #1440 from zjffdu/ZEPPELIN-1427 and squashes the following commits:

62dbcad [Jeff Zhang] add unit test
a7ba67d [Jeff Zhang] ZEPPELIN-1427. Scala z.show() doesn't work on v.0.6.1

(cherry picked from commit c717daf)
Signed-off-by: Mina Lee <[email protected]>
@asfgit asfgit closed this in c717daf Sep 26, 2016
pedrozatta pushed a commit to pedrozatta/zeppelin that referenced this pull request Oct 27, 2016
### What is this PR for?
`ZeppelinContext.show` doesn't work for spark 1.6. The root cause is that `Dataset` is also available in spark 1.6, so the following line will be false when cls is `Dataset` while o is `Dataframe` in spark 1.6
```
if (cls.isInstance(o)) {
```
This PR create a list of supported class and make it a member of `ZeppelinContext `so that we don't need to create it every time.

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

### Todos
* [ ] - Task

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

### How should this be tested?
Tested it manually on spark 1.6 using the following sample code
```
z.show(sqlContext.sql("show tables"))
```

### Screenshots (if appropriate)
![image](https://cloud.githubusercontent.com/assets/164491/18657995/cb25d8e8-7f31-11e6-8b26-62f39bc5587e.png)

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

Author: Jeff Zhang <[email protected]>

Closes apache#1440 from zjffdu/ZEPPELIN-1427 and squashes the following commits:

62dbcad [Jeff Zhang] add unit test
a7ba67d [Jeff Zhang] ZEPPELIN-1427. Scala z.show() doesn't work on v.0.6.1
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.

2 participants