[GitHub] zeppelin pull request #2442: [ZEPPELIN-2679] JDBC. precode for session

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin pull request #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
GitHub user tinkoff-dwh opened a pull request:

    https://github.com/apache/zeppelin/pull/2442

    [ZEPPELIN-2679] JDBC. precode for session

    ### 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)
    1. set property **default.sessionPrecode** `set search_path='test_session_precode'`
    2. run paragraph `show search_path`
   
    ### Questions:
    * Does the licenses files need update? no
    * Is there breaking changes for older versions? no
    * Does this needs documentation? no


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tinkoff-dwh/zeppelin ZEPPELIN-2679

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/2442.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2442
   
----
commit bd3d80952ca56e709379632318ba1193a17338ae
Author: Tinkoff DWH <[hidden email]>
Date:   2017-06-23T11:58:20Z

    [ZEPPELIN-2679] jdbc. precode for session

commit ae7a0d63966a1ddbf89292715221d041ecdc2b74
Author: Tinkoff DWH <[hidden email]>
Date:   2017-06-26T04:14:11Z

    [ZEPPELIN-2679] tests

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin issue #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
Github user tinkoff-dwh commented on the issue:

    https://github.com/apache/zeppelin/pull/2442
 
    @felixcheung
    session == database session. added documentation


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin pull request #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
In reply to this post by asfgit
Github user tinkoff-dwh closed the pull request at:

    https://github.com/apache/zeppelin/pull/2442


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin pull request #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
In reply to this post by asfgit
GitHub user tinkoff-dwh reopened a pull request:

    https://github.com/apache/zeppelin/pull/2442

    [ZEPPELIN-2679] JDBC. precode for session

    ### 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)
    1. set property **default.sessionPrecode** `set search_path='test_session_precode'`
    2. run paragraph `show search_path`
   
    ### Questions:
    * Does the licenses files need update? no
    * Is there breaking changes for older versions? no
    * Does this needs documentation? no


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tinkoff-dwh/zeppelin ZEPPELIN-2679

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/2442.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2442
   
----
commit bd3d80952ca56e709379632318ba1193a17338ae
Author: Tinkoff DWH <[hidden email]>
Date:   2017-06-23T11:58:20Z

    [ZEPPELIN-2679] jdbc. precode for session

commit ae7a0d63966a1ddbf89292715221d041ecdc2b74
Author: Tinkoff DWH <[hidden email]>
Date:   2017-06-26T04:14:11Z

    [ZEPPELIN-2679] tests

commit 719d0a2fdf73a478c4475c8147da8d26646933ff
Author: isys.mreshetov <[hidden email]>
Date:   2017-06-29T04:35:10Z

    ZEPPELIN-2679 docs

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin issue #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
In reply to this post by asfgit
Github user zjffdu commented on the issue:

    https://github.com/apache/zeppelin/pull/2442
 
    @tinkoff-dwh What do you mean `database session` ? From the code, `precode` is executed  per statement.  And what is the usage scenario for this ? Could you give an example ? Thanks


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin issue #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
In reply to this post by asfgit
Github user tinkoff-dwh commented on the issue:

    https://github.com/apache/zeppelin/pull/2442
 
    @zjffdu
    yep, per statement.
    for exp.
    There is jdbc interpreter per user  (postgres).
    There are many users and each user has scheme to work.
    1. set search_path='#{user}'   (default.sessionPrecode)
    2. run paragraph `select ...`
    the user will work with the correct scheme
   
    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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin issue #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
In reply to this post by asfgit
Github user zjffdu commented on the issue:

    https://github.com/apache/zeppelin/pull/2442
 
    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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin issue #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
In reply to this post by asfgit
Github user tinkoff-dwh commented on the issue:

    https://github.com/apache/zeppelin/pull/2442
 
    @zjffdu
    another instance? user == analitic. It is real task from production. The user does't configure interpreter, it is work of administrator.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin issue #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
In reply to this post by asfgit
Github user zjffdu commented on the issue:

    https://github.com/apache/zeppelin/pull/2442
 
    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.
   
    ```
    %spark.init
   
    set property_1=value_1
    set property_2=value_2
    ```
    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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin issue #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
In reply to this post by asfgit
Github user tinkoff-dwh commented on the issue:

    https://github.com/apache/zeppelin/pull/2442
 
    it is JDBC interpretator, set variables in first paragraph  will not work because we have connection pool and the paragraphs will be executed in different statemnets. What problem with shared notes. Фny user can execute and everyone will have their `precode`.  `set search_path='#{user}`  #{user} will be replaced with the username from the context


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin issue #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
In reply to this post by asfgit
Github user tinkoff-dwh commented on the issue:

    https://github.com/apache/zeppelin/pull/2442
 
    Ready to review


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin issue #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
In reply to this post by asfgit
Github user tinkoff-dwh commented on the issue:

    https://github.com/apache/zeppelin/pull/2442
 
    Ready to review


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin issue #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
In reply to this post by asfgit
Github user tinkoff-dwh commented on the issue:

    https://github.com/apache/zeppelin/pull/2442
 
    Ready to review


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin issue #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
In reply to this post by asfgit
Github user tinkoff-dwh commented on the issue:

    https://github.com/apache/zeppelin/pull/2442
 
    Ready to review


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin issue #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
In reply to this post by asfgit
Github user tinkoff-dwh commented on the issue:

    https://github.com/apache/zeppelin/pull/2442
 
    Ready to review


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] zeppelin issue #2442: [ZEPPELIN-2679] JDBC. precode for session

asfgit
In reply to this post by asfgit
Github user tinkoff-dwh commented on the issue:

    https://github.com/apache/zeppelin/pull/2442
 
    Ready to review


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Loading...