Uh oh!
There was an error while loading. Please reload this page.
[ZEPPELIN-2679] JDBC. precode for session - #2442
Conversation
tinkoff-dwh
commented
Jun 29, 2017
@felixcheung |
zjffdu
commented
Jun 29, 2017
@tinkoff-dwh What do you mean |
tinkoff-dwh
commented
Jun 29, 2017
@zjffdu
or set another variables and values will be available to code in the paragraph (SET TIME ZONE, custom variables, etc...). User == analitic (usually) and he doesn't have to write this in the code of paragraph |
zjffdu
commented
Jul 1, 2017
I am not sure whether this is a good idea to put custom initialization code in interpreter setting. Because I think one goal of notebook is to allow user to reproduce it easily without change note. So any non-trivial thing should be put to note itself. Otherwise user don't know how to reproduce the note result in another zeppelin instance. |
tinkoff-dwh
commented
Jul 3, 2017
@zjffdu |
zjffdu
commented
Jul 3, 2017
I am thinking that every interpreter could have one special interpreter for initializing interpreter setting and custom enviroment requirement for his note. And do the initialization at the first paragraph. e.g. So that the note could be shared to other people, and other people can reproduce the note result easily. My point is that note should be self-contained thing that could be reproduced when it is shared to other people However it is still very immature idea. |
it is JDBC interpretator, set variables in first paragraph will not work because we have connections pool and the paragraphs will be executed in different statemnets. What problem with shared notes. Фny user can execute and everyone will have their |
tinkoff-dwh
commented
Jul 11, 2017
Ready to review |
5 similar comments
tinkoff-dwh
commented
Jul 17, 2017
Ready to review |
tinkoff-dwh
commented
Jul 24, 2017
Ready to review |
tinkoff-dwh
commented
Jul 31, 2017
Ready to review |
tinkoff-dwh
commented
Aug 4, 2017
Ready to review |
tinkoff-dwh
commented
Aug 10, 2017
Ready to review |
dwhsys
commented
Sep 11, 2017
Can someone review please? |
tinkoff-dwh
commented
Nov 15, 2017
Ready to review |
1 similar comment
tinkoff-dwh
commented
Nov 29, 2017
Ready to review |
mebelousov
commented
Mar 13, 2018
Every day our users run about 1000 queries in the Greenplum (open source Postgres-based DB). The precode I believe the precode in JDBC interpreter is necessary feature for entreprise users. |
zjffdu
commented
Mar 13, 2018
Mostly LGTM, one concern is about the name |
mebelousov
commented
Mar 13, 2018
@zjffdu, you are right, sessionPrecode is renamed to statementPrecode. Since 0.8.0 I will recommend to run JDBC interpreter per note in isolated mode due to Interpreter Lifecycle Manager: the table results accumulate in ResourcePool and JVMs grow in size, but ILM will drop non-active JVMs. |
| } | ||
| @Test | ||
| public void testSessionPrecode() throws SQLException, IOException { |
| } | ||
| @Test | ||
| public void testIncorrectSessionPrecode() throws SQLException, IOException { |
| } | ||
| @Test | ||
| public void testSessionPrecodeWithAnotherPrefix() throws SQLException, IOException { |
# Conflicts: # jdbc/src/test/java/org/apache/zeppelin/jdbc/JDBCInterpreterTest.java
zjffdu
commented
Mar 16, 2018
@tinkoff-dwh I just realised that zeppelin already support hooks for interpreter. I think you don't need to do it specifically for jdbc interpreter, instead we could introduce one general property like |
mebelousov
commented
Mar 26, 2018
@zjffdu The JDBC interpreter allow to split query and precode must run before each statement in paragraph. Therefore the single way for precode for all interpreters looks unrealizable. The rename to |
zjffdu
commented
Mar 26, 2018
Sorry @mebelousov I don't get why the general hooks could not satisfy you. The hook can run for each paragraph. Could you explain a little bit more ? Maybe an example would be very helpful. |
mebelousov
commented
Apr 3, 2018
@zjffdu |
kapustor
commented
Apr 6, 2018
+1 |
anermakov
commented
Apr 6, 2018
+1 Must have |
aspekt112
commented
Apr 6, 2018
+1 |
1 similar comment
Sanikadze
commented
Apr 6, 2018
+1 |
zjffdu
commented
Apr 9, 2018
@tinkoff-dwh Could you rebase the PR ? |
# Conflicts: # jdbc/src/test/java/org/apache/zeppelin/jdbc/JDBCInterpreterTest.java
zjffdu
commented
Apr 10, 2018
@tinkoff-dwh@mebelousov Could you retrigger the build ? Travis seems fail |
mebelousov
commented
Apr 10, 2018
@zjffdu I have retriggered several times. Travis fails with the same error on all jobs. |
zjffdu
commented
Apr 10, 2018
@mebelousov Could you clean the travis cache and for a dummy force push to trigger the build ? |
zjffdu
commented
Apr 11, 2018
Cache is clean now. I try to retrigger from both accounts. The result is the same. |
zjffdu
commented
Apr 11, 2018
Could you create another PR to trigger the build ? |
### What is this PR for?
We have a precode for interpreter (all interpreters) which executes once after start interpreter. With it we can create shared code that will be available in the paragraph, create tables in the database and etc.
This precode for jdbc only which executes before run paragraph in same session (sql). In this precode we can declare session variables that will be available when you run paragraph (any sql which will be executed before the paragraph). For example `set application_name='#{user};`
Previous discussion in #2442
### What type of PR is it?
Feature
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2679
### How should this be tested?
(jdbc interpreter, postgres)
1. set property **default.statementPrecode** `set application_name='#{user}';`
2. run paragraph `select current_setting('application_name');`
### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no
Author: tinkoff-dwh <tinkoff.dwh@gmail.com>
Author: mebelousov <mebelousov@ya.ru>
Author: Tinkoff DWH <tinkoff.dwh@gmail.com>
Author: Renjith Kamath <rkamath@apache.org>
Author: isys.mreshetov <m.reshetov@i-sys.ru>
Closes#2920 from mebelousov/ZEPPELIN-2679 and squashes the following commits:
d610805 [mebelousov] Revert "ZEPPELIN-3406 Travis build failure due to npm error"
11cbc44 [Renjith Kamath] ZEPPELIN-3406 Travis build failure due to npm error
11f89a5 [mebelousov] ZEPPELIN-2679 Small fix in docs
e9d36d2 [mebelousov] Merge remote-tracking branch 'apache/master' into ZEPPELIN-267900aeabf [tinkoff-dwh] ZEPPELIN-2679 fix checkstyle
f7529ca [tinkoff-dwh] Merge remote-tracking branch 'upstream/master' into ZEPPELIN-267907b41c5 [tinkoff-dwh] ZEPPELIN-2679 rename test methods
cd0d6ed [tinkoff-dwh] Merge remote-tracking branch 'upstream/master' into ZEPPELIN-26797bba0db [tinkoff-dwh] ZEPPELIN-2679 rename session to statement
719d0a2 [isys.mreshetov] ZEPPELIN-2679 docs
ae7a0d6 [Tinkoff DWH] [ZEPPELIN-2679] tests
bd3d809 [Tinkoff DWH] [ZEPPELIN-2679] jdbc. precode for sessionWe have a precode for interpreter (all interpreters) which executes once after start interpreter. With it we can create shared code that will be available in the paragraph, create tables in the database and etc.
This precode for jdbc only which executes before run paragraph in same session (sql). In this precode we can declare session variables that will be available when you run paragraph (any sql which will be executed before the paragraph). For example `set application_name='#{user};`
Previous discussion in #2442
Feature
https://issues.apache.org/jira/browse/ZEPPELIN-2679
(jdbc interpreter, postgres)
1. set property **default.statementPrecode** `set application_name='#{user}';`
2. run paragraph `select current_setting('application_name');`
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no
Author: tinkoff-dwh <tinkoff.dwh@gmail.com>
Author: mebelousov <mebelousov@ya.ru>
Author: Tinkoff DWH <tinkoff.dwh@gmail.com>
Author: Renjith Kamath <rkamath@apache.org>
Author: isys.mreshetov <m.reshetov@i-sys.ru>
Closes#2920 from mebelousov/ZEPPELIN-2679 and squashes the following commits:
d610805 [mebelousov] Revert "ZEPPELIN-3406 Travis build failure due to npm error"
11cbc44 [Renjith Kamath] ZEPPELIN-3406 Travis build failure due to npm error
11f89a5 [mebelousov] ZEPPELIN-2679 Small fix in docs
e9d36d2 [mebelousov] Merge remote-tracking branch 'apache/master' into ZEPPELIN-267900aeabf [tinkoff-dwh] ZEPPELIN-2679 fix checkstyle
f7529ca [tinkoff-dwh] Merge remote-tracking branch 'upstream/master' into ZEPPELIN-267907b41c5 [tinkoff-dwh] ZEPPELIN-2679 rename test methods
cd0d6ed [tinkoff-dwh] Merge remote-tracking branch 'upstream/master' into ZEPPELIN-26797bba0db [tinkoff-dwh] ZEPPELIN-2679 rename session to statement
719d0a2 [isys.mreshetov] ZEPPELIN-2679 docs
ae7a0d6 [Tinkoff DWH] [ZEPPELIN-2679] tests
bd3d809 [Tinkoff DWH] [ZEPPELIN-2679] jdbc. precode for session
(cherry picked from commit edf3c25)
Signed-off-by: Jeff Zhang <zjffdu@apache.org>### What is this PR for?
We have a precode for interpreter (all interpreters) which executes once after start interpreter. With it we can create shared code that will be available in the paragraph, create tables in the database and etc.
This precode for jdbc only which executes before run paragraph in same session (sql). In this precode we can declare session variables that will be available when you run paragraph (any sql which will be executed before the paragraph). For example `set application_name='#{user};`
Previous discussion in apache#2442
### What type of PR is it?
Feature
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2679
### How should this be tested?
(jdbc interpreter, postgres)
1. set property **default.statementPrecode** `set application_name='#{user}';`
2. run paragraph `select current_setting('application_name');`
### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no
Author: tinkoff-dwh <tinkoff.dwh@gmail.com>
Author: mebelousov <mebelousov@ya.ru>
Author: Tinkoff DWH <tinkoff.dwh@gmail.com>
Author: Renjith Kamath <rkamath@apache.org>
Author: isys.mreshetov <m.reshetov@i-sys.ru>
Closesapache#2920 from mebelousov/ZEPPELIN-2679 and squashes the following commits:
d610805 [mebelousov] Revert "ZEPPELIN-3406 Travis build failure due to npm error"
11cbc44 [Renjith Kamath] ZEPPELIN-3406 Travis build failure due to npm error
11f89a5 [mebelousov] ZEPPELIN-2679 Small fix in docs
e9d36d2 [mebelousov] Merge remote-tracking branch 'apache/master' into ZEPPELIN-2679
00aeabf [tinkoff-dwh] ZEPPELIN-2679 fix checkstyle
f7529ca [tinkoff-dwh] Merge remote-tracking branch 'upstream/master' into ZEPPELIN-2679
07b41c5 [tinkoff-dwh] ZEPPELIN-2679 rename test methods
cd0d6ed [tinkoff-dwh] Merge remote-tracking branch 'upstream/master' into ZEPPELIN-2679
7bba0db [tinkoff-dwh] ZEPPELIN-2679 rename session to statement
719d0a2 [isys.mreshetov] ZEPPELIN-2679 docs
ae7a0d6 [Tinkoff DWH] [ZEPPELIN-2679] tests
bd3d809 [Tinkoff DWH] [ZEPPELIN-2679] jdbc. precode for sessionWe have a precode for interpreter (all interpreters) which executes once after start interpreter. With it we can create shared code that will be available in the paragraph, create tables in the database and etc.
This precode for jdbc only which executes before run paragraph in same session (sql). In this precode we can declare session variables that will be available when you run paragraph (any sql which will be executed before the paragraph). For example `set application_name='#{user};`
Previous discussion in apache#2442
Feature
https://issues.apache.org/jira/browse/ZEPPELIN-2679
(jdbc interpreter, postgres)
1. set property **default.statementPrecode** `set application_name='#{user}';`
2. run paragraph `select current_setting('application_name');`
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no
Author: tinkoff-dwh <tinkoff.dwh@gmail.com>
Author: mebelousov <mebelousov@ya.ru>
Author: Tinkoff DWH <tinkoff.dwh@gmail.com>
Author: Renjith Kamath <rkamath@apache.org>
Author: isys.mreshetov <m.reshetov@i-sys.ru>
Closesapache#2920 from mebelousov/ZEPPELIN-2679 and squashes the following commits:
d610805 [mebelousov] Revert "ZEPPELIN-3406 Travis build failure due to npm error"
11cbc44 [Renjith Kamath] ZEPPELIN-3406 Travis build failure due to npm error
11f89a5 [mebelousov] ZEPPELIN-2679 Small fix in docs
e9d36d2 [mebelousov] Merge remote-tracking branch 'apache/master' into ZEPPELIN-2679
00aeabf [tinkoff-dwh] ZEPPELIN-2679 fix checkstyle
f7529ca [tinkoff-dwh] Merge remote-tracking branch 'upstream/master' into ZEPPELIN-2679
07b41c5 [tinkoff-dwh] ZEPPELIN-2679 rename test methods
cd0d6ed [tinkoff-dwh] Merge remote-tracking branch 'upstream/master' into ZEPPELIN-2679
7bba0db [tinkoff-dwh] ZEPPELIN-2679 rename session to statement
719d0a2 [isys.mreshetov] ZEPPELIN-2679 docs
ae7a0d6 [Tinkoff DWH] [ZEPPELIN-2679] tests
bd3d809 [Tinkoff DWH] [ZEPPELIN-2679] jdbc. precode for session
(cherry picked from commit edf3c25)
Signed-off-by: Jeff Zhang <zjffdu@apache.org>
(cherry picked from commit 1795ed4)
Change-Id: If10f5f7f87628931e5528999bc72d7874efe9a78
What is this PR for?
We have a precode for interpreter (all interpreters) which executes once after start interpreter. With it we can create shared code that will be available in the paragraph, create tables in the database and etc. This precode for jdbc only which executes before run paragraph in same session (sql). In this precode we can declare session variables that will be available when you run paragraph (any sql which will be executed before the paragraph). For exabple
set search_path='public,#{user}'What type of PR is it?
Feature
What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2679
How should this be tested?
(jdbc interpreter, postgres)
set search_path='test_session_precode'show search_pathQuestions: