Commit graph

10 commits

Author SHA1 Message Date
Lee moon soo
850fd81a51 [ZEPPELIN-212] Multiple paragraph results
### What is this PR for?
Currently a paragraph can display only a single type of result.
For example
```
print("""
%text textout
%html htmlout
""")
```

will display only last display system detected, "htmlout".

This pr implements multiple results supports, so not only the last, but also all the display systems in a paragraph outputs can be displayed.

To do that, Note.json format need to be changed. from

```
   paragraph : [
      {
          result : {
              code: "",
              type: "",
              msg: ""
          },
          config : {
             graph : {},
             ...
          },
          ...
      },
      ...
   ],
   ...
```

to

```
   paragraph : [
      {
          results : {
             {
                code: "",
                msg: [
                   {
                        type: "",
                        data: ""
                    },
                    {
                        type: "",
                        data: ""
                     },
                     ...
                ]
          },
          config : {
             results : [
                {
                    graph : {},
                },
                {
                    graph : {},
                },
                ...
             ]
          },
          ...
      },
      ...
   ],
   ...
```

### What type of PR is it?
Improvement

### Todos
* [x] - Make InterpreterResult and InterpreterOutput support multiple display system
* [x] - Automatic migration old format to new format
* [x] - Render multiple results in front-end
* [x] - Take care Importing old notebook format
* [x] - Make helium framework support multiple results

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

### How should this be tested?

run following code in a single spark paragraph.
```
%spark
// default output is text
(1 to 3).foreach{i=>
  println(new java.util.Date())
  Thread.sleep(1000)
}

// print something in html
println(s"""%html <h3><font style="color:blue">Some HTML</font></h3>""")

// create table
println(s"""%table key\tvalue
sun\t100
moon\t200

""")

// display text again
println("""%text""")
(1 to 3).foreach{i=>
  println(new java.util.Date())
  Thread.sleep(1000)
}

// another table
Thread.sleep(1000)
println(s"""%table key\tvalue
apple\t100
banana\t200
""")
```

### Screenshots (if appropriate)
![multipleout](https://cloud.githubusercontent.com/assets/1540981/20465902/23379948-af1d-11e6-85cf-4d70597fb94e.gif)

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

Author: Lee moon soo <moon@apache.org>

Closes #1658 from Leemoonsoo/ZEPPELIN-212 and squashes the following commits:

0c6a13c [Lee moon soo] Merge remote-tracking branch 'origin/master' into ZEPPELIN-212
519cf23 [Lee moon soo] Update PythonInterpreterPandasSqlTest
e6268ac [Lee moon soo] Update PythonInterpreterMatplotlibTest.java
f5034b8 [Lee moon soo] Merge remote-tracking branch 'origin/master' into ZEPPELIN-212
d5981d5 [Lee moon soo] Merge remote-tracking branch 'origin/master' into ZEPPELIN-212
a1fe729 [Lee moon soo] document note format change
282504e [Lee moon soo] Merge remote-tracking branch 'origin/master' into ZEPPELIN-212
7ab6679 [Lee moon soo] update selenium test
6a897a5 [Lee moon soo] Update rest-api doc
cbbd58a [Lee moon soo] update unittest
e89c9b8 [Lee moon soo] restore tutoral note
3ba37b7 [Lee moon soo] Let old version import note without error
d09e03f [Lee moon soo] enable helium only in the last result
6682908 [Lee moon soo] Remove unnecessary listener method
0f1d28f [Lee moon soo] Merge branch 'master' into ZEPPELIN-212
73b3a81 [Lee moon soo] update selenium test
e69f1a1 [Lee moon soo] update test
f12230f [Lee moon soo] Remove unnecessary newline in test
26e201a [Lee moon soo] Update testcase
b01d70f [Lee moon soo] Make helium app work
0a5b4d1 [Lee moon soo] Update HeliumApplicationFactoryTest
d8ca07f [Lee moon soo] update NotebookTest
aaf9778 [Lee moon soo] fix r test
3e43df4 [Lee moon soo] make zeppelin-web test pass
1d6fd3e [Lee moon soo] fix compile errors
0156ffc [Lee moon soo] take care angular object
804768d [Lee moon soo] Take care output streaming
57d6b2f [Lee moon soo] Render multiple results
95b6037 [Lee moon soo] Multiple results
2016-11-30 17:23:57 -08:00
Jan Hentschel
99b975f5c5 [ZEPPELIN-429] Replaced explicit types with diamonds
### What is this PR for?

Changed all occurrences of explicit types to diamonds in the different modules.
### What type of PR is it?

Improvement
### Todos
##
### What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-429
### How should this be tested?

Run the normal Maven build process.
### Screenshots (if appropriate)
### Questions:
- Does the licenses files need update? No
- Is there breaking changes for older versions? No
- Does this needs documentation? No

Author: Jan Hentschel <jan.hentschel@ultratendency.com>

Closes #1551 from HorizonNet/ZEPPELIN-429 and squashes the following commits:

7bde50e [Jan Hentschel] [ZEPPELIN-429] Incorporated latest changes
58a94ac [Jan Hentschel] Merge branch 'master' of https://github.com/apache/zeppelin into ZEPPELIN-429
b56bf24 [Jan Hentschel] [ZEPPELIN-429] Replaced explicit types with diamonds
2016-11-01 11:59:22 +09:00
CloverHearts
c884a5113e ZEPPELIN-1108 ] Doesn't work autocompletion for Postgresql interpreter
### What is this PR for?
Doesn't work autocompletion for postgresql interpreter
'Completion' There is a problem with the return type of implementation.

```
org.apache.zeppelin.interpreter.InterpreterException: org.apache.thrift.transport.TTransportException
	at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.completion(RemoteInterpreter.java:396)
	at org.apache.zeppelin.interpreter.LazyOpenInterpreter.completion(LazyOpenInterpreter.java:122)
	at org.apache.zeppelin.notebook.Paragraph.completion(Paragraph.java:216)
	at org.apache.zeppelin.notebook.Note.completion(Note.java:488)
	at org.apache.zeppelin.socket.NotebookServer.completion(NotebookServer.java:729)
	at org.apache.zeppelin.socket.NotebookServer.onMessage(NotebookServer.java:202)
	at org.apache.zeppelin.socket.NotebookSocket.onWebSocketText(NotebookSocket.java:56)
	at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextMessage(JettyListenerEventDriver.java:128)
	at org.eclipse.jetty.websocket.common.message.SimpleTextMessage.messageComplete(SimpleTextMessage.java:69)
	at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:65)
	at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextFrame(JettyListenerEventDriver.java:122)
	at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:161)
	at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:309)
	at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:214)
	at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220)
	at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:258)
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:632)
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:480)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.thrift.transport.TTransportException
	at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:132)
	at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
	at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:429)
	at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:318)
	at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:219)
	at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
	at org.apache.zeppelin.interpreter.thrift.RemoteInterpreterService$Client.recv_completion(RemoteInterpreterService.java:346)
	at org.apache.zeppelin.interpreter.thrift.RemoteInterpreterService$Client.completion(RemoteInterpreterService.java:330)
	at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.completion(RemoteInterpreter.java:392)

```

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

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

### How should this be tested?
try to completion for Postgresql interpreter paragraph.

```
%psql
SELET * F (ctrl + shift + space)
```

### Screenshots (if appropriate)
![psql](https://cloud.githubusercontent.com/assets/10525473/16565072/ead568f8-4245-11e6-857a-c440d14e6f6f.gif)

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

Author: CloverHearts <cloverheartsdev+github@gmail.com>

Closes #1126 from cloverhearts/bugfix/psql-completion and squashes the following commits:

5931133 [CloverHearts] fixed test case for postgresql completion
bb24bc0 [CloverHearts] bug fixed auto completion for postgresql interpreter
2016-07-06 14:50:55 +09:00
AhyoungRyu
7b00dffd98 [ZEPPELIN-982] Improve interpreter completion API
### What is this PR for?
When people implement a new interpreter, they extend [interpreter.java](https://github.com/apache/zeppelin/blob/master/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/Interpreter.java) as described in [here](https://zeppelin.apache.org/docs/0.6.0-SNAPSHOT/development/writingzeppelininterpreter.html). Among the several methods in [interpreter.java](https://github.com/apache/zeppelin/blob/master/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/Interpreter.java), [completion API](https://github.com/apache/zeppelin/blob/master/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/Interpreter.java#L109) enables auto-completion.

However this API is too simple compared to other project's auto-completion and hard to add more at the moment. So for the aspect of further expansion, it would be better to separate and restructure this API before the this release( 0.6.0 ).

### What type of PR is it?
Improvement

### Todos
* [x] - Create new structure : `InterpreterCompletion` in `RemoteInterpreterService.thrift` and regenerate `zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/*` files
* [x] - Change all existing `List<String> completion` -> `List<InterpreterCompletion> completion`
* [x] - Change `paragraph.controller.js` to point real `name` and `value`

### What is the Jira issue?
[ZEPPELIN-982](https://issues.apache.org/jira/browse/ZEPPELIN-982)

### How should this be tested?
Since this improvement is just API change, it should work same as before. So after applying this patch, and check whether auto-completion works well or not.

Use `. + ctrl` for auto-completion. For example,

```
%spark
sc.version
```

When after typing `sc.` and pushing  `. + ctrl` down, `version` should be shown in the auto-completion list.

### Screenshots (if appropriate)
![auto_completion](https://cloud.githubusercontent.com/assets/10060731/15952521/72937782-2e76-11e6-8246-4faf0dd77a5b.gif)

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

Author: AhyoungRyu <fbdkdud93@hanmail.net>

Closes #984 from AhyoungRyu/ZEPPELIN-982 and squashes the following commits:

311dc29 [AhyoungRyu] Fix travis
9d384ec [AhyoungRyu] Address @minalee feedback
fdfae8f [AhyoungRyu] Address @jongyoul review
bd4f8c0 [AhyoungRyu] Remove abstract and make it return null by default
f8352c7 [AhyoungRyu] Fix travis error
43d81f6 [AhyoungRyu] Remove console.log
24912fa [AhyoungRyu] Fix type casting error in SparkInterpreter
80e295b [AhyoungRyu] Change return type
bd04c22 [AhyoungRyu] Apply new InterpreterCompletion class to all interpreter class files
c283043 [AhyoungRyu] Apply new InterpreterCompletion class under zeppelin-zengine/
dbecc51 [AhyoungRyu] Apply new InterpreterCompletion class under zeppelin-server/
6449455 [AhyoungRyu] Apply new InterpreterCompletion class under zeppelin-interpreter/
919b159 [AhyoungRyu] Add automatically generated thrift class
9e69e11 [AhyoungRyu] Change v -> v.name & v.value in front
73e374e [AhyoungRyu] Define InterpreterCompletion structure to thrift file
2016-06-16 08:06:07 -07:00
Jongyoul Lee
92e0454b08 [ZEPPELIN-615] Restore postgresql functionality
### What is this PR for?
Restore postgresql functionality and fix some mistake #361.

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

### Is there a relevant Jira issue?
ZEPPELIN-614

### How should this be tested?
Outline the steps to test the PR here.

### Screenshots (if appropriate)

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

Author: Jongyoul Lee <jongyoul@gmail.com>

Closes #653 from jongyoul/hotfix/restore-psql and squashes the following commits:

8917ada [Jongyoul Lee] [HOTFIX] Temporary support on Postgresql - Related #361
fde5a2b [Jongyoul Lee] [HOTFIX] Temporary support on Postgresql - Related #361
2016-01-18 23:21:42 +09:00
beeva-victorgarcia
404846f969 JDBC generic interpreter
Only you need to add to the classpath the jdbc connector jar and the interpreter add the particular properties for each db.
In the file zeppelin-daemon.sh add:
ZEPPELIN_CLASSPATH+=":${ZEPPELIN_HOME}/jdbc/jdbc/connector jar"

Author: beeva-victorgarcia <victor.garcia@beeva.com>
Author: Victor <viktor.manuel.garcia@gmail.com>
Author: vgmartinez <viktor.manuel.garcia@gmail.com>

Closes #361 from vgmartinez/jdbc_interpreter and squashes the following commits:

2513c1b [vgmartinez] Merge branch 'master' into jdbc_interpreter
8046692 [vgmartinez] merged with master
e602621 [beeva-victorgarcia] remove spaces
37a4c1a [beeva-victorgarcia] remove dependency
4085849 [beeva-victorgarcia] rebase branch
bd20ac2 [beeva-victorgarcia] remove README.md
2f93406 [beeva-victorgarcia] clean commit
f0ad06d [beeva-victorgarcia] Merge branch 'master' of https://github.com/apache/incubator-zeppelin
a0e0d54 [beeva-victorgarcia] add some test
fe92f89 [beeva-victorgarcia] add multiple connections for interpreter
a06718c [beeva-victorgarcia] -a
09006f1 [Victor] fix test
462c3b1 [Victor] Merge branch 'master' of https://github.com/apache/incubator-zeppelin into jdbc_interpreter
a66a5b7 [Victor] add descriptions
710699c [Victor] deleted cassandra/.cache-main from commit
4f28f5a [Victor] change psql to jdbc
53d0a81 [Victor] generic interpreter for jdbc
2016-01-18 12:25:52 +09:00
Prabhjyot Singh
ff99ecba1b ZEPPELIN-541 - increase logging in application
### What is this PR for?
To increase logging in the application, so as it

### What type of PR is it?
Refactoring

### Todos
* [x] - replace all printStackTrace() to LOGGER.error
* [x] - all catch block that doesn't throw exception, should have logging

### Is there a relevant Jira issue?
Yes, ZEPPELIN-541

### Screenshots (if appropriate)
N/A

Author: Prabhjyot Singh <prabhjyotsingh@gmail.com>

Closes #579 from prabhjyotsingh/increaseLogging and squashes the following commits:

ba053f5 [Prabhjyot Singh] revert note.json
648c65c [Prabhjyot Singh] fix CI
6d927fc [Prabhjyot Singh] Every catch should log error/info message or should throw an exception
7f8b70c [Prabhjyot Singh] replace printStackTrace() to LOGGER.error
2016-01-10 15:31:57 +09:00
tzolov
baab124cf3 ZEPPELIN-349: Resolve NPE on null cell values
When the query response contains null column values the following NPE is thrown:
java.lang.NullPointerException
at org.apache.zeppelin.postgresql.PostgreSqlInterpreter.replaceReservedChars(PostgreSqlInterpreter.java:278)
at org.apache.zeppelin.postgresql.PostgreSqlInterpreter.executeSql(PostgreSqlInterpreter.java:235)

Author: tzolov <christian.tzolov@gmail.com>

Closes #348 from tzolov/ZEPPELIN-349 and squashes the following commits:

de70c88 [tzolov] ZEPPELIN-349: Format test code
fff3448 [tzolov] ZEPPELIN-349: Resolve NPE on null cell values
2015-10-19 14:23:07 +09:00
tzolov
5bfcf33a45 ZEPPELIN-215: PostgreSQL completer - initial implementation
Author: tzolov <christian.tzolov@gmail.com>

Closes #198 from tzolov/ZEPPELIN-215 and squashes the following commits:

35c40d4 [tzolov] ZEPPELIN-215: Handle failures during jdbc connectio initialization
271ef14 [tzolov] ZEPPELIN-215: Handle addition and removal of completions on Data Model changes
d87942e [tzolov] ZEPPELIN-215: Update the auto-complete metadata (schema, tables, columns) on update SQL queries
91ce7f4 [tzolov] ZEPPELIN-215: Fix a case where the cursor is close after the end of the buffer
d2393d6 [tzolov] ZEPPELIN-215: clean logging messages
4dd2a36 [tzolov] ZEPPELIN-215: resolve delimiter bug
0a3910d [tzolov] ZEPPELIN-215: Add DB schema names to the completion list
cef2b95 [tzolov] ZEPPELIN-215: Use JDBC.setMastRows(maxResults) to restrict the size of the displied rows
c6acd0e [tzolov] ZEPPELIN-215: PostgreSQL completer - initial implementation
2015-08-25 20:24:25 -07:00
tzolov
cc5b4bcfa7 ZEPPELIN-70: Add PostgreSQL Interpreter
modified:   conf/zeppelin-site.xml.template
	modified:   pom.xml
	new file:   postgresql/pom.xml
	new file:   postgresql/src/main/java/org/apache/zeppelin/postgresql/PostgreSqlInterpreter.java
	new file:   postgresql/src/test/java/org/apache/zeppelin/postgresql/PostgreSqlInterpreterTest.java

Author: tzolov <christian.tzolov@gmail.com>

Closes #172 from tzolov/ZEPPELIN-70 and squashes the following commits:

5de507d [tzolov] ZEPPELIN-70: Remove the obsolete dependencies from the POM
a3db5f7 [tzolov] ZEPPELING-70: Rebase to upstream master
745ad3d [tzolov] ZEPPELIN-70: Add PostgreSQL JDBC license statement
a7d26dd [tzolov] ZEPPELIN-70: Closed previous connection before open new one. Register psql in ZeppelinConfiguration
886eab5 [tzolov] ZEPPELIN-70: Add property to control the number of SQL results shown in the display.
880bde0 [tzolov] ZEPPELIN-70: Improve javadoc. Clean pom formating
ba1b5b8 [tzolov] ZEPPELIN-70: Fix spelling
60544a1 [tzolov] ZEPPELIN-70: Add jdbc driver name as configuration property
841d67c [tzolov] ZEPPELIN-70: Add PostgreSQL Interpreter
2015-08-09 12:51:27 -07:00